home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: Chap1.tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Corel 10 Texture (image/corel10Texture)
| ext
| Unsupported |
1%
| dexvert
| Croteam texture file (image/croteamTextureFile)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| text/x-matlab
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 0a 25 20 43 68 61 70 | 74 65 72 20 47 65 74 74 |%.% Chap|ter Gett|
|00000010| 69 6e 67 20 53 74 61 72 | 74 65 64 0a 25 0a 25 20 |ing Star|ted.%.% |
|00000020| 20 20 20 20 20 20 20 20 | 20 20 41 75 74 68 6f 72 | | Author|
|00000030| 3a 20 45 72 69 63 6b 20 | 47 61 6c 6c 65 73 69 6f |: Erick |Gallesio|
|00000040| 20 5b 65 67 40 6b 61 6f | 6c 69 6e 2e 75 6e 69 63 | [eg@kao|lin.unic|
|00000050| 65 2e 66 72 5d 0a 25 20 | 20 20 20 43 72 65 61 74 |e.fr].% | Creat|
|00000060| 69 6f 6e 20 64 61 74 65 | 3a 20 20 34 2d 4e 6f 76 |ion date|: 4-Nov|
|00000070| 2d 31 39 39 32 20 31 35 | 3a 33 37 0a 25 20 4c 61 |-1992 15|:37.% La|
|00000080| 73 74 20 66 69 6c 65 20 | 75 70 64 61 74 65 3a 20 |st file |update: |
|00000090| 32 34 2d 4a 75 6c 2d 31 | 39 39 36 20 31 36 3a 32 |24-Jul-1|996 16:2|
|000000a0| 38 0a 0a 5c 63 68 61 70 | 74 65 72 7b 47 65 74 74 |8..\chap|ter{Gett|
|000000b0| 69 6e 67 20 53 74 61 72 | 74 65 64 7d 0a 0a 25 5c |ing Star|ted}..%\|
|000000c0| 62 65 67 69 6e 7b 66 6c | 75 73 68 72 69 67 68 74 |begin{fl|ushright|
|000000d0| 7d 0a 25 7b 5c 48 75 67 | 65 5c 62 66 20 31 7d 5c |}.%{\Hug|e\bf 1}\|
|000000e0| 5c 5b 35 6d 6d 5d 0a 25 | 7b 5c 48 75 67 65 5c 62 |\[5mm].%|{\Huge\b|
|000000f0| 66 20 47 65 74 74 69 6e | 67 20 53 74 61 72 74 65 |f Gettin|g Starte|
|00000100| 64 7d 0a 25 5c 65 6e 64 | 7b 66 6c 75 73 68 72 69 |d}.%\end|{flushri|
|00000110| 67 68 74 7d 0a 0a 0a 54 | 68 69 73 20 63 68 61 70 |ght}...T|his chap|
|00000120| 74 65 72 20 77 69 6c 6c | 20 65 78 70 6c 61 69 6e |ter will| explain|
|00000130| 20 74 68 65 20 74 68 69 | 6e 67 73 20 79 6f 75 20 | the thi|ngs you |
|00000140| 6d 75 73 74 20 6b 6e 6f | 77 20 74 6f 20 62 65 67 |must kno|w to beg|
|00000150| 69 6e 20 74 6f 20 6d 61 | 6e 69 70 75 6c 61 74 65 |in to ma|nipulate|
|00000160| 20 54 6b 0a 77 69 64 67 | 65 74 73 20 61 73 20 7b | Tk.widg|ets as {|
|00000170| 5c 73 74 6b 6c 6f 73 7d | 20 6f 62 6a 65 63 74 73 |\stklos}| objects|
|00000180| 2e 20 54 68 69 73 20 69 | 73 20 61 20 73 68 6f 72 |. This i|s a shor|
|00000190| 74 20 69 6e 74 72 6f 64 | 75 63 74 69 6f 6e 20 66 |t introd|uction f|
|000001a0| 6f 72 20 70 72 6f 67 72 | 61 6d 6d 69 6e 67 20 74 |or progr|amming t|
|000001b0| 68 65 0a 54 6b 20 74 6f | 6f 6c 6b 69 74 20 77 69 |he.Tk to|olkit wi|
|000001c0| 74 68 20 6f 62 6a 65 63 | 74 73 2e 20 49 66 20 79 |th objec|ts. If y|
|000001d0| 6f 75 20 6b 6e 6f 77 20 | 68 6f 77 20 74 6f 20 70 |ou know |how to p|
|000001e0| 72 6f 67 72 61 6d 20 69 | 74 20 77 69 74 68 20 74 |rogram i|t with t|
|000001f0| 68 65 20 54 63 6c 20 6c | 61 6e 67 75 61 67 65 2c |he Tcl l|anguage,|
|00000200| 0a 79 6f 75 20 77 69 6c | 6c 20 73 65 65 20 74 68 |.you wil|l see th|
|00000210| 61 74 20 74 68 69 6e 67 | 73 20 61 72 65 20 6e 6f |at thing|s are no|
|00000220| 74 20 74 6f 6f 20 6d 75 | 63 68 20 64 69 66 66 65 |t too mu|ch diffe|
|00000230| 72 65 6e 74 20 28 61 74 | 20 6c 65 61 73 74 20 61 |rent (at| least a|
|00000240| 74 20 66 69 72 73 74 0a | 73 69 67 68 74 29 2e 20 |t first.|sight). |
|00000250| 41 20 67 6f 6f 64 20 69 | 6e 74 72 6f 64 75 63 74 |A good i|ntroduct|
|00000260| 69 6f 6e 20 74 6f 20 54 | 6b 20 70 72 6f 67 72 61 |ion to T|k progra|
|00000270| 6d 6d 69 6e 67 20 69 6e | 20 54 63 6c 20 63 61 6e |mming in| Tcl can|
|00000280| 20 62 65 20 66 6f 75 6e | 64 20 69 6e 0a 5c 63 69 | be foun|d in.\ci|
|00000290| 74 65 7b 4f 75 73 74 65 | 72 2d 62 6f 6b 7d 20 6f |te{Ouste|r-bok} o|
|000002a0| 72 20 5c 63 69 74 65 7b | 57 65 6c 63 68 2d 62 6f |r \cite{|Welch-bo|
|000002b0| 6f 6b 7d 2e 0a 0a 5c 73 | 65 63 74 69 6f 6e 7b 46 |ok}...\s|ection{F|
|000002c0| 69 72 73 74 20 73 74 65 | 70 73 7d 0a 0a 57 68 65 |irst ste|ps}..Whe|
|000002d0| 6e 20 79 6f 75 20 77 61 | 6e 74 20 74 6f 20 75 73 |n you wa|nt to us|
|000002e0| 65 20 74 68 65 20 54 6b | 20 74 6f 6f 6c 6b 69 74 |e the Tk| toolkit|
|000002f0| 20 77 69 74 68 20 74 68 | 65 20 7b 5c 73 74 6b 6c | with th|e {\stkl|
|00000300| 6f 73 7d 2c 20 79 6f 75 | 20 6d 75 73 74 20 66 69 |os}, you| must fi|
|00000310| 72 73 74 20 63 61 6c 6c | 0a 74 68 65 20 7b 5c 73 |rst call|.the {\s|
|00000320| 74 6b 7d 20 69 6e 74 65 | 72 70 72 65 74 65 72 2e |tk} inte|rpreter.|
|00000330| 20 4c 61 75 6e 63 68 69 | 6e 67 20 74 68 65 20 69 | Launchi|ng the i|
|00000340| 6e 74 65 72 70 72 65 74 | 65 72 20 69 73 20 75 73 |nterpret|er is us|
|00000350| 75 61 6c 6c 79 20 64 6f | 6e 65 20 62 79 20 61 0a |ually do|ne by a.|
|00000360| 63 61 6c 6c 20 74 6f 20 | 74 68 65 20 73 68 65 6c |call to |the shel|
|00000370| 6c 20 73 63 72 69 70 74 | 20 7b 5c 74 74 20 73 74 |l script| {\tt st|
|00000380| 6b 7d 20 77 68 69 63 68 | 20 6d 75 73 74 20 68 61 |k} which| must ha|
|00000390| 76 65 20 62 65 65 6e 20 | 69 6e 73 74 61 6c 6c 65 |ve been |installe|
|000003a0| 64 20 69 6e 20 61 0a 73 | 74 61 6e 64 61 72 64 20 |d in a.s|tandard |
|000003b0| 70 6c 61 63 65 2e 20 4f | 6e 63 65 2c 20 74 68 65 |place. O|nce, the|
|000003c0| 20 69 6e 74 65 72 70 72 | 65 74 65 72 20 69 73 20 | interpr|eter is |
|000003d0| 69 6e 69 74 69 61 6c 69 | 7a 65 64 2c 20 61 20 73 |initiali|zed, a s|
|000003e0| 6d 61 6c 6c 20 73 71 75 | 61 72 65 20 77 69 6e 64 |mall squ|are wind|
|000003f0| 6f 77 0a 77 69 6c 6c 20 | 61 70 70 65 61 72 20 6f |ow.will |appear o|
|00000400| 6e 20 79 6f 75 72 20 64 | 69 73 70 6c 61 79 2e 20 |n your d|isplay. |
|00000410| 54 68 69 73 20 77 69 6e | 64 6f 77 20 69 73 20 63 |This win|dow is c|
|00000420| 61 6c 6c 65 64 20 74 68 | 65 20 7b 5c 65 6d 20 72 |alled th|e {\em r|
|00000430| 6f 6f 74 0a 77 69 6e 64 | 6f 77 5c 69 6e 64 65 78 |oot.wind|ow\index|
|00000440| 7b 72 6f 6f 74 20 77 69 | 6e 64 6f 77 7d 7d 2e 20 |{root wi|ndow}}. |
|00000450| 49 74 73 20 76 61 6c 75 | 65 20 69 73 20 61 6c 77 |Its valu|e is alw|
|00000460| 61 79 73 20 72 65 74 61 | 69 6e 65 64 20 69 6e 20 |ays reta|ined in |
|00000470| 74 68 65 20 67 6c 6f 62 | 61 6c 0a 76 61 72 69 61 |the glob|al.varia|
|00000480| 62 6c 65 20 7b 5c 74 74 | 20 2a 74 6f 70 2d 72 6f |ble {\tt| *top-ro|
|00000490| 6f 74 2a 5c 69 6e 64 65 | 78 7b 2a 74 6f 70 2d 72 |ot*\inde|x{*top-r|
|000004a0| 6f 6f 74 2a 7d 7d 2e 0a | 0a 4f 6e 63 65 20 74 68 |oot*}}..|.Once th|
|000004b0| 65 20 54 6b 20 69 6e 69 | 74 69 61 6c 69 7a 61 74 |e Tk ini|tializat|
|000004c0| 69 6f 6e 20 69 73 20 63 | 6f 6d 70 6c 65 74 65 2c |ion is c|omplete,|
|000004d0| 20 79 6f 75 20 68 61 76 | 65 20 74 6f 20 6c 6f 61 | you hav|e to loa|
|000004e0| 64 20 74 68 65 20 66 69 | 6c 65 20 0a 7b 5c 74 74 |d the fi|le .{\tt|
|000004f0| 20 54 6b 2d 63 6c 61 73 | 73 65 73 7d 2e 20 54 68 | Tk-clas|ses}. Th|
|00000500| 69 73 20 63 61 6e 20 62 | 65 20 64 6f 6e 65 20 62 |is can b|e done b|
|00000510| 79 20 0a 5c 62 65 67 69 | 6e 7b 71 75 6f 74 65 7d |y .\begi|n{quote}|
|00000520| 0a 5c 62 65 67 69 6e 7b | 76 65 72 62 61 74 69 6d |.\begin{|verbatim|
|00000530| 7d 0a 28 72 65 71 75 69 | 72 65 20 22 54 6b 2d 63 |}.(requi|re "Tk-c|
|00000540| 6c 61 73 73 65 73 22 29 | 0a 5c 65 6e 64 7b 76 65 |lasses")|.\end{ve|
|00000550| 72 62 61 74 69 6d 7d 0a | 5c 65 6e 64 7b 71 75 6f |rbatim}.|\end{quo|
|00000560| 74 65 7d 0a 0a 54 68 65 | 20 7b 5c 74 74 20 54 6b |te}..The| {\tt Tk|
|00000570| 2d 63 6c 61 73 73 65 73 | 7d 20 66 69 6c 65 20 63 |-classes|} file c|
|00000580| 6f 6e 74 61 69 6e 73 20 | 61 20 73 65 74 20 6f 66 |ontains |a set of|
|00000590| 20 7b 5c 74 74 20 61 75 | 74 6f 6c 6f 61 64 7d 73 | {\tt au|toload}s|
|000005a0| 20 66 6f 72 20 61 6c 6c | 20 74 68 65 0a 54 6b 20 | for all| the.Tk |
|000005b0| 77 69 64 67 65 74 73 20 | 64 65 66 69 6e 65 64 20 |widgets |defined |
|000005c0| 69 6e 20 74 68 65 20 7b | 5c 73 74 6b 7d 20 72 65 |in the {|\stk} re|
|000005d0| 6c 65 61 73 65 2e 20 49 | 66 20 79 6f 75 20 70 6c |lease. I|f you pl|
|000005e0| 61 6e 20 74 6f 20 61 6c | 77 61 79 73 20 77 6f 72 |an to al|ways wor|
|000005f0| 6b 20 77 69 74 68 0a 74 | 68 6f 73 65 20 63 6c 61 |k with.t|hose cla|
|00000600| 73 73 65 73 2c 20 79 6f | 75 20 63 61 6e 20 70 75 |sses, yo|u can pu|
|00000610| 74 20 74 68 69 73 20 6c | 69 6e 65 20 69 6e 20 79 |t this l|ine in y|
|00000620| 6f 75 72 20 7b 5c 73 74 | 6b 7d 20 69 6e 69 74 20 |our {\st|k} init |
|00000630| 66 69 6c 65 20 28 69 2e | 65 2e 20 69 6e 20 74 68 |file (i.|e. in th|
|00000640| 65 0a 66 69 6c 65 20 60 | 60 7b 5c 74 74 20 5c 7e |e.file `|`{\tt \~|
|00000650| 2f 2e 73 74 6b 72 63 7d | 27 27 29 20 74 6f 20 61 |/.stkrc}|'') to a|
|00000660| 76 6f 69 64 20 28 6d 61 | 6e 75 61 6c 29 20 6c 6f |void (ma|nual) lo|
|00000670| 61 64 69 6e 67 20 6f 66 | 20 74 68 69 73 20 66 69 |ading of| this fi|
|00000680| 6c 65 2e 0a 0a 46 72 6f | 6d 20 6e 6f 77 2c 20 77 |le...Fro|m now, w|
|00000690| 65 20 61 72 65 20 61 62 | 6c 65 20 74 6f 20 69 6e |e are ab|le to in|
|000006a0| 74 65 72 61 63 74 20 77 | 69 74 68 20 74 68 65 20 |teract w|ith the |
|000006b0| 54 6b 20 74 6f 6f 6c 6b | 69 74 2e 20 54 72 79 20 |Tk toolk|it. Try |
|000006c0| 74 6f 20 65 6e 74 65 72 | 20 74 68 65 20 66 6f 6c |to enter| the fol|
|000006d0| 6c 6f 77 69 6e 67 0a 6c | 69 6e 65 73 20 61 74 20 |lowing.l|ines at |
|000006e0| 74 68 65 20 7b 5c 73 74 | 6b 7d 20 70 72 6f 6d 70 |the {\st|k} promp|
|000006f0| 74 3a 20 0a 5c 62 65 67 | 69 6e 7b 71 75 6f 74 65 |t: .\beg|in{quote|
|00000700| 7d 0a 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |}.\begin|{verbati|
|00000710| 6d 7d 20 20 20 20 20 20 | 20 20 0a 28 64 65 66 69 |m} | .(defi|
|00000720| 6e 65 20 68 65 6c 6c 6f | 20 28 6d 61 6b 65 20 3c |ne hello| (make <|
|00000730| 4c 61 62 65 6c 3e 20 3a | 74 65 78 74 20 22 48 65 |Label> :|text "He|
|00000740| 6c 6c 6f 2c 20 77 6f 72 | 6c 64 22 29 29 0a 5c 65 |llo, wor|ld")).\e|
|00000750| 6e 64 7b 76 65 72 62 61 | 74 69 6d 7d 0a 5c 65 6e |nd{verba|tim}.\en|
|00000760| 64 7b 71 75 6f 74 65 7d | 0a 0a 54 68 65 20 63 61 |d{quote}|..The ca|
|00000770| 6c 6c 20 74 6f 20 7b 5c | 74 74 20 6d 61 6b 65 7d |ll to {\|tt make}|
|00000780| 20 63 72 65 61 74 65 73 | 20 61 20 6e 65 77 20 6f | creates| a new o|
|00000790| 62 6a 65 63 74 20 28 69 | 2e 65 2e 20 61 6e 20 69 |bject (i|.e. an i|
|000007a0| 6e 73 74 61 6e 63 65 20 | 6f 66 20 74 68 65 20 63 |nstance |of the c|
|000007b0| 6c 61 73 73 20 7b 5c 74 | 74 0a 3c 4c 61 62 65 6c |lass {\t|t.<Label|
|000007c0| 3e 7d 29 20 77 69 74 68 | 20 69 74 73 20 73 6c 6f |>}) with| its slo|
|000007d0| 74 20 7b 5c 74 74 20 74 | 65 78 74 7d 20 66 69 6c |t {\tt t|ext} fil|
|000007e0| 6c 65 64 20 77 69 74 68 | 20 74 68 65 20 73 74 72 |led with| the str|
|000007f0| 69 6e 67 20 7b 5c 74 74 | 20 22 48 65 6c 6c 6f 2c |ing {\tt| "Hello,|
|00000800| 0a 77 6f 72 6c 64 22 7d | 2e 20 49 6e 20 74 68 65 |.world"}|. In the|
|00000810| 20 61 62 6f 76 65 20 65 | 78 61 6d 70 6c 65 2c 20 | above e|xample, |
|00000820| 74 68 69 73 20 6e 65 77 | 20 6f 62 6a 65 63 74 20 |this new| object |
|00000830| 69 73 20 61 73 73 69 67 | 6e 65 64 20 74 6f 20 74 |is assig|ned to t|
|00000840| 68 65 20 73 79 6d 62 6f | 6c 0a 7b 5c 74 74 20 68 |he symbo|l.{\tt h|
|00000850| 65 6c 6c 6f 7d 2e 20 45 | 76 65 6e 2c 20 69 66 20 |ello}. E|ven, if |
|00000860| 61 20 6e 65 77 20 6c 61 | 62 65 6c 20 69 73 20 63 |a new la|bel is c|
|00000870| 72 65 61 74 65 64 2c 20 | 6e 6f 74 68 69 6e 67 20 |reated, |nothing |
|00000880| 77 69 6c 6c 20 62 65 20 | 64 69 73 70 6c 61 79 65 |will be |displaye|
|00000890| 64 20 6f 6e 0a 79 6f 75 | 72 20 73 63 72 65 65 6e |d on.you|r screen|
|000008a0| 2e 20 59 6f 75 27 6c 6c | 20 68 61 76 65 20 74 6f |. You'll| have to|
|000008b0| 20 75 73 65 20 61 20 7b | 5c 65 6d 20 67 65 6f 6d | use a {|\em geom|
|000008c0| 65 74 72 79 20 6d 61 6e | 61 67 65 72 7d 5c 69 6e |etry man|ager}\in|
|000008d0| 64 65 78 7b 67 65 6f 6d | 65 74 72 79 0a 6d 61 6e |dex{geom|etry.man|
|000008e0| 61 67 65 72 7d 20 66 6f | 72 20 64 69 73 70 6c 61 |ager} fo|r displa|
|000008f0| 79 69 6e 67 20 61 20 54 | 6b 20 77 69 64 67 65 74 |ying a T|k widget|
|00000900| 20 6f 6e 74 6f 20 73 63 | 72 65 65 6e 2e 20 54 77 | onto sc|reen. Tw|
|00000910| 6f 20 77 69 6e 64 6f 77 | 20 6d 61 6e 61 67 65 72 |o window| manager|
|00000920| 73 20 61 72 65 0a 70 72 | 6f 76 69 64 65 64 20 77 |s are.pr|ovided w|
|00000930| 69 74 68 20 54 6b 2c 20 | 6e 61 6d 65 6c 79 20 74 |ith Tk, |namely t|
|00000940| 68 65 20 7b 5c 65 6d 20 | 70 61 63 6b 65 72 7d 5c |he {\em |packer}\|
|00000950| 69 6e 64 65 78 7b 70 61 | 63 6b 65 72 7d 20 61 6e |index{pa|cker} an|
|00000960| 64 20 74 68 65 20 7b 5c | 65 6d 0a 70 6c 61 63 65 |d the {\|em.place|
|00000970| 72 7d 5c 69 6e 64 65 78 | 7b 70 6c 61 63 65 72 7d |r}\index|{placer}|
|00000980| 2e 20 42 6f 74 68 20 63 | 6f 6d 6d 61 6e 64 20 68 |. Both c|ommand h|
|00000990| 61 76 65 20 61 20 66 75 | 6c 6c 20 73 65 74 20 6f |ave a fu|ll set o|
|000009a0| 66 20 6f 70 74 69 6f 6e | 73 20 77 68 69 63 68 20 |f option|s which |
|000009b0| 77 69 6c 6c 0a 62 65 20 | 64 65 74 61 69 6c 65 64 |will.be |detailed|
|000009c0| 20 6c 61 74 65 72 20 28 | 73 65 65 20 5c 72 65 66 | later (|see \ref|
|000009d0| 7b 70 61 63 6b 65 72 7d | 29 2e 20 46 6f 72 20 6e |{packer}|). For n|
|000009e0| 6f 77 2c 20 77 65 20 77 | 69 6c 6c 20 6a 75 73 74 |ow, we w|ill just|
|000009f0| 20 75 73 65 20 74 68 65 | 20 70 61 63 6b 65 72 0a | use the| packer.|
|00000a00| 69 6e 20 69 74 73 20 73 | 69 6d 70 6c 65 72 20 66 |in its s|impler f|
|00000a10| 6f 72 6d 3a 0a 5c 62 65 | 67 69 6e 7b 71 75 6f 74 |orm:.\be|gin{quot|
|00000a20| 65 7d 0a 5c 62 65 67 69 | 6e 7b 76 65 72 62 61 74 |e}.\begi|n{verbat|
|00000a30| 69 6d 7d 20 20 20 20 20 | 20 20 20 0a 28 70 61 63 |im} | .(pac|
|00000a40| 6b 20 68 65 6c 6c 6f 29 | 0a 5c 65 6e 64 7b 76 65 |k hello)|.\end{ve|
|00000a50| 72 62 61 74 69 6d 7d 0a | 5c 65 6e 64 7b 71 75 6f |rbatim}.|\end{quo|
|00000a60| 74 65 7d 0a 70 65 72 6d | 69 74 73 20 74 6f 20 6d |te}.perm|its to m|
|00000a70| 61 70 20 74 68 65 20 7b | 5c 74 74 20 68 65 6c 6c |ap the {|\tt hell|
|00000a80| 6f 7d 20 62 75 74 74 6f | 6e 20 6f 6e 74 6f 20 73 |o} butto|n onto s|
|00000a90| 63 72 65 65 6e 2e 20 0a | 0a 4c 65 74 20 75 73 20 |creen. .|.Let us |
|00000aa0| 73 65 65 20 66 75 72 74 | 68 65 72 20 68 6f 77 20 |see furt|her how |
|00000ab0| 74 68 65 20 7b 5c 74 74 | 20 68 65 6c 6c 6f 7d 20 |the {\tt| hello} |
|00000ac0| 62 75 74 74 6f 6e 20 69 | 73 20 62 75 69 6c 74 2e |button i|s built.|
|00000ad0| 20 55 73 69 6e 67 20 64 | 65 73 63 72 69 62 65 0a | Using d|escribe.|
|00000ae0| 6f 6e 20 69 74 20 77 69 | 6c 6c 20 64 69 73 70 6c |on it wi|ll displ|
|00000af0| 61 79 3a 0a 5c 62 65 67 | 69 6e 7b 71 75 6f 74 65 |ay:.\beg|in{quote|
|00000b00| 7d 0a 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |}.\begin|{verbati|
|00000b10| 6d 7d 0a 23 5b 3c 6c 61 | 62 65 6c 3e 20 65 31 34 |m}.#[<la|bel> e14|
|00000b20| 34 34 5d 20 69 73 20 61 | 6e 20 69 6e 73 74 61 6e |44] is a|n instan|
|00000b30| 63 65 20 6f 66 20 63 6c | 61 73 73 20 3c 6c 61 62 |ce of cl|ass <lab|
|00000b40| 65 6c 3e 0a 53 6c 6f 74 | 73 20 61 72 65 3a 20 0a |el>.Slot|s are: .|
|00000b50| 20 20 20 20 20 69 64 20 | 3d 20 23 5b 54 6b 2d 63 | id |= #[Tk-c|
|00000b60| 6f 6d 6d 61 6e 64 20 2e | 76 31 5d 0a 20 20 20 20 |ommand .|v1]. |
|00000b70| 20 65 69 64 20 3d 20 23 | 5b 54 6b 2d 63 6f 6d 6d | eid = #|[Tk-comm|
|00000b80| 61 6e 64 20 2e 76 31 5d | 0a 20 20 20 20 20 70 61 |and .v1]|. pa|
|00000b90| 72 65 6e 74 20 3d 20 23 | 5b 54 6b 2d 63 6f 6d 6d |rent = #|[Tk-comm|
|00000ba0| 61 6e 64 20 2e 5d 0a 20 | 20 20 20 20 62 69 74 6d |and .]. | bitm|
|00000bb0| 61 70 20 3d 20 22 22 0a | 20 20 20 20 20 77 69 64 |ap = "".| wid|
|00000bc0| 74 68 20 3d 20 30 0a 20 | 20 20 20 20 68 65 69 67 |th = 0. | heig|
|00000bd0| 68 74 20 3d 20 30 0a 20 | 20 20 20 20 61 6e 63 68 |ht = 0. | anch|
|00000be0| 6f 72 20 3d 20 22 63 65 | 6e 74 65 72 22 0a 20 20 |or = "ce|nter". |
|00000bf0| 20 20 20 66 6f 6e 74 20 | 3d 20 22 39 78 31 35 22 | font |= "9x15"|
|00000c00| 0a 20 20 20 20 20 66 6f | 72 65 67 72 6f 75 6e 64 |. fo|reground|
|00000c10| 20 3d 20 22 42 6c 61 63 | 6b 22 0a 20 20 20 20 20 | = "Blac|k". |
|00000c20| 70 61 64 2d 78 20 3d 20 | 31 0a 20 20 20 20 20 70 |pad-x = |1. p|
|00000c30| 61 64 2d 79 20 3d 20 31 | 0a 20 20 20 20 20 74 65 |ad-y = 1|. te|
|00000c40| 78 74 20 3d 20 22 48 65 | 6c 6c 6f 2c 20 77 6f 72 |xt = "He|llo, wor|
|00000c50| 6c 64 22 0a 20 20 20 20 | 20 74 65 78 74 2d 76 61 |ld". | text-va|
|00000c60| 72 69 61 62 6c 65 20 3d | 20 22 22 0a 20 20 20 20 |riable =| "". |
|00000c70| 20 62 61 63 6b 67 72 6f | 75 6e 64 20 3d 20 22 23 | backgro|und = "#|
|00000c80| 63 63 63 63 63 63 22 0a | 20 20 20 20 20 62 6f 72 |cccccc".| bor|
|00000c90| 64 65 72 2d 77 69 64 74 | 68 20 3d 20 30 0a 20 20 |der-widt|h = 0. |
|00000ca0| 20 20 20 63 75 72 73 6f | 72 20 3d 20 22 22 0a 20 | curso|r = "". |
|00000cb0| 20 20 20 20 72 65 6c 69 | 65 66 20 3d 20 22 66 6c | reli|ef = "fl|
|00000cc0| 61 74 22 0a 5c 65 6e 64 | 7b 76 65 72 62 61 74 69 |at".\end|{verbati|
|00000cd0| 6d 7d 0a 5c 65 6e 64 7b | 71 75 6f 74 65 7d 0a 0a |m}.\end{|quote}..|
|00000ce0| 7b 5c 74 74 20 49 64 5c | 69 6e 64 65 78 7b 49 64 |{\tt Id\|index{Id|
|00000cf0| 20 73 6c 6f 74 7d 7d 2c | 20 7b 5c 74 74 20 45 69 | slot}},| {\tt Ei|
|00000d00| 64 5c 69 6e 64 65 78 7b | 45 69 64 20 73 6c 6f 74 |d\index{|Eid slot|
|00000d10| 7d 7d 20 61 6e 64 20 7b | 5c 74 74 0a 70 61 72 65 |}} and {|\tt.pare|
|00000d20| 6e 74 5c 69 6e 64 65 78 | 7b 70 61 72 65 6e 74 20 |nt\index|{parent |
|00000d30| 73 6c 6f 74 7d 7d 20 73 | 6c 6f 74 73 20 61 72 65 |slot}} s|lots are|
|00000d40| 20 70 72 65 73 65 6e 74 | 20 69 6e 20 61 6c 6c 20 | present| in all |
|00000d50| 54 6b 20 77 69 64 67 65 | 74 73 20 61 6e 64 20 61 |Tk widge|ts and a|
|00000d60| 72 65 20 75 73 65 64 0a | 62 79 20 74 68 65 20 73 |re used.|by the s|
|00000d70| 79 73 74 65 6d 2e 20 44 | 6f 6e 27 74 20 74 72 79 |ystem. D|on't try|
|00000d80| 20 74 6f 20 63 68 61 6e | 67 65 20 74 68 65 69 72 | to chan|ge their|
|00000d90| 20 76 61 6c 75 65 2e 20 | 20 4f 74 68 65 72 20 73 | value. | Other s|
|00000da0| 6c 6f 74 73 20 64 65 70 | 65 6e 64 20 6f 66 20 74 |lots dep|end of t|
|00000db0| 68 65 0a 6b 69 6e 64 20 | 28 69 2e 65 2e 20 74 68 |he.kind |(i.e. th|
|00000dc0| 65 20 63 6c 61 73 73 29 | 20 6f 66 20 77 69 64 67 |e class)| of widg|
|00000dd0| 65 74 2e 20 54 68 65 20 | 73 6c 6f 74 73 20 6c 69 |et. The |slots li|
|00000de0| 73 74 65 64 20 61 62 6f | 76 65 20 63 6f 72 72 65 |sted abo|ve corre|
|00000df0| 73 70 6f 6e 64 20 74 6f | 0a 74 68 65 20 76 61 72 |spond to|.the var|
|00000e00| 69 6f 75 73 20 54 6b 20 | 6f 70 74 69 6f 6e 73 20 |ious Tk |options |
|00000e10| 61 76 61 69 6c 61 62 6c | 65 20 6f 6e 20 61 20 6c |availabl|e on a l|
|00000e20| 61 62 65 6c 2e 20 20 4f | 66 20 63 6f 75 72 73 65 |abel. O|f course|
|00000e30| 20 79 6f 75 20 63 61 6e | 0a 63 6f 6e 73 75 6c 74 | you can|.consult|
|00000e40| 2f 63 68 61 6e 67 65 20 | 74 68 65 69 72 20 76 61 |/change |their va|
|00000e50| 6c 75 65 20 77 69 74 68 | 20 74 68 65 20 73 74 61 |lue with| the sta|
|00000e60| 6e 64 61 72 64 20 7b 5c | 74 74 20 73 6c 6f 74 2d |ndard {\|tt slot-|
|00000e70| 72 65 66 7d 20 6f 72 20 | 7b 5c 74 74 0a 73 6c 6f |ref} or |{\tt.slo|
|00000e80| 74 2d 73 65 74 21 7d 20 | 70 72 69 6d 69 74 69 76 |t-set!} |primitiv|
|00000e90| 65 73 2e 20 20 46 6f 72 | 20 69 6e 73 74 61 6e 63 |es. For| instanc|
|00000ea0| 65 2c 20 6f 6e 65 20 63 | 61 6e 20 63 68 61 6e 67 |e, one c|an chang|
|00000eb0| 65 20 74 68 65 20 62 61 | 63 6b 67 72 6f 75 6e 64 |e the ba|ckground|
|00000ec0| 20 63 6f 6c 6f 72 0a 6f | 66 20 74 68 65 20 7b 5c | color.o|f the {\|
|00000ed0| 74 74 20 68 65 6c 6c 6f | 7d 20 62 75 74 74 6f 6e |tt hello|} button|
|00000ee0| 20 77 69 74 68 20 74 68 | 65 20 66 6f 6c 6c 6f 77 | with th|e follow|
|00000ef0| 69 6e 67 20 66 6f 72 6d | 3a 0a 5c 62 65 67 69 6e |ing form|:.\begin|
|00000f00| 7b 71 75 6f 74 65 7d 0a | 5c 62 65 67 69 6e 7b 76 |{quote}.|\begin{v|
|00000f10| 65 72 62 61 74 69 6d 7d | 0a 28 73 6c 6f 74 2d 73 |erbatim}|.(slot-s|
|00000f20| 65 74 21 20 68 65 6c 6c | 6f 20 27 62 61 63 6b 67 |et! hell|o 'backg|
|00000f30| 72 6f 75 6e 64 20 22 43 | 68 6f 63 6f 6c 61 74 65 |round "C|hocolate|
|00000f40| 22 29 0a 5c 65 6e 64 7b | 76 65 72 62 61 74 69 6d |").\end{|verbatim|
|00000f50| 7d 0a 5c 65 6e 64 7b 71 | 75 6f 74 65 7d 0a 6f 72 |}.\end{q|uote}.or|
|00000f60| 2c 20 75 73 69 6e 67 20 | 74 68 65 20 7b 5c 73 74 |, using |the {\st|
|00000f70| 6b 6c 6f 73 7d 20 67 65 | 6e 65 72 61 6c 69 7a 65 |klos} ge|neralize|
|00000f80| 64 20 61 73 73 69 67 6e | 6d 65 6e 74 2c 0a 5c 62 |d assign|ment,.\b|
|00000f90| 65 67 69 6e 7b 71 75 6f | 74 65 7d 0a 5c 62 65 67 |egin{quo|te}.\beg|
|00000fa0| 69 6e 7b 76 65 72 62 61 | 74 69 6d 7d 0a 28 73 65 |in{verba|tim}.(se|
|00000fb0| 74 21 20 28 62 61 63 6b | 67 72 6f 75 6e 64 20 68 |t! (back|ground h|
|00000fc0| 65 6c 6c 6f 29 20 22 43 | 68 6f 63 6f 6c 61 74 65 |ello) "C|hocolate|
|00000fd0| 22 29 0a 5c 65 6e 64 7b | 76 65 72 62 61 74 69 6d |").\end{|verbatim|
|00000fe0| 7d 0a 5c 65 6e 64 7b 71 | 75 6f 74 65 7d 0a 0a 4f |}.\end{q|uote}..O|
|00000ff0| 66 20 63 6f 75 72 73 65 | 2c 20 74 68 65 20 62 61 |f course|, the ba|
|00001000| 63 6b 67 72 6f 75 6e 64 | 20 76 61 6c 75 65 20 63 |ckground| value c|
|00001010| 61 6e 20 62 65 20 71 75 | 65 72 69 65 64 20 77 69 |an be qu|eried wi|
|00001020| 74 68 0a 5c 62 65 67 69 | 6e 7b 71 75 6f 74 65 7d |th.\begi|n{quote}|
|00001030| 0a 5c 62 65 67 69 6e 7b | 76 65 72 62 61 74 69 6d |.\begin{|verbatim|
|00001040| 7d 0a 28 73 6c 6f 74 2d | 72 65 66 20 68 65 6c 6c |}.(slot-|ref hell|
|00001050| 6f 20 27 62 61 63 6b 67 | 72 6f 75 6e 64 29 0a 20 |o 'backg|round). |
|00001060| 20 20 20 20 20 20 20 2d | 2d 3e 20 22 43 68 6f 63 | -|-> "Choc|
|00001070| 6f 6c 61 74 65 22 0a 5c | 65 6e 64 7b 76 65 72 62 |olate".\|end{verb|
|00001080| 61 74 69 6d 7d 0a 5c 65 | 6e 64 7b 71 75 6f 74 65 |atim}.\e|nd{quote|
|00001090| 7d 0a 5c 6e 6f 69 6e 64 | 65 6e 74 0a 6f 72 0a 5c |}.\noind|ent.or.\|
|000010a0| 62 65 67 69 6e 7b 71 75 | 6f 74 65 7d 0a 5c 62 65 |begin{qu|ote}.\be|
|000010b0| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0a 28 62 |gin{verb|atim}.(b|
|000010c0| 61 63 6b 67 72 6f 75 6e | 64 20 68 65 6c 6c 6f 29 |ackgroun|d hello)|
|000010d0| 0a 20 20 20 20 20 20 20 | 20 2d 2d 3e 20 22 43 68 |. | --> "Ch|
|000010e0| 6f 63 6f 6c 61 74 65 22 | 0a 5c 65 6e 64 7b 76 65 |ocolate"|.\end{ve|
|000010f0| 72 62 61 74 69 6d 7d 0a | 5c 65 6e 64 7b 71 75 6f |rbatim}.|\end{quo|
|00001100| 74 65 7d 0a 0a 48 65 72 | 65 2c 20 7b 5c 74 74 20 |te}..Her|e, {\tt |
|00001110| 62 61 63 6b 67 72 6f 75 | 6e 64 7d 20 69 73 20 75 |backgrou|nd} is u|
|00001120| 73 65 64 20 61 73 20 61 | 6e 20 61 63 63 65 73 73 |sed as a|n access|
|00001130| 6f 72 5c 69 6e 64 65 78 | 7b 61 63 63 65 73 73 6f |or\index|{accesso|
|00001140| 72 7d 20 6f 66 20 74 68 | 65 20 6c 61 62 65 6c 0a |r} of th|e label.|
|00001150| 62 61 63 6b 67 72 6f 75 | 6e 64 2e 20 49 74 20 77 |backgrou|nd. It w|
|00001160| 6f 75 6c 64 20 62 65 20 | 61 6c 73 6f 20 70 6f 73 |ould be |also pos|
|00001170| 73 69 62 6c 65 20 74 6f | 20 73 70 65 63 69 66 79 |sible to| specify|
|00001180| 20 74 68 69 73 20 76 61 | 6c 75 65 20 61 74 20 6c | this va|lue at l|
|00001190| 61 62 65 6c 0a 69 6e 73 | 74 61 6e 74 69 61 74 69 |abel.ins|tantiati|
|000011a0| 6f 6e 20 77 69 74 68 20 | 74 68 65 20 7b 5c 74 74 |on with |the {\tt|
|000011b0| 20 3a 62 61 63 6b 67 72 | 6f 75 6e 64 7d 20 7b 5c | :backgr|ound} {\|
|000011c0| 65 6d 20 69 6e 69 74 69 | 61 6c 69 7a 61 74 69 6f |em initi|alizatio|
|000011d0| 6e 20 6b 65 79 77 6f 72 | 64 0a 5c 69 6e 64 65 78 |n keywor|d.\index|
|000011e0| 7b 69 6e 69 74 69 61 6c | 69 7a 61 74 69 6f 6e 20 |{initial|ization |
|000011f0| 6b 65 79 77 6f 72 64 7d | 7d 20 61 6e 64 20 74 68 |keyword}|} and th|
|00001200| 65 20 73 61 6d 65 20 77 | 69 6e 64 6f 77 20 63 6f |e same w|indow co|
|00001210| 75 6c 64 20 68 61 76 65 | 20 62 65 20 6f 62 74 61 |uld have| be obta|
|00001220| 69 6e 65 64 0a 77 69 74 | 68 20 74 68 65 20 66 6f |ined.wit|h the fo|
|00001230| 6c 6c 6f 77 69 6e 67 20 | 7b 5c 74 74 20 6d 61 6b |llowing |{\tt mak|
|00001240| 65 7d 20 63 61 6c 6c 20 | 0a 5c 62 65 67 69 6e 7b |e} call |.\begin{|
|00001250| 71 75 6f 74 65 7d 0a 5c | 62 65 67 69 6e 7b 76 65 |quote}.\|begin{ve|
|00001260| 72 62 61 74 69 6d 7d 0a | 28 64 65 66 69 6e 65 20 |rbatim}.|(define |
|00001270| 68 65 6c 6c 6f 20 28 6d | 61 6b 65 20 3c 4c 61 62 |hello (m|ake <Lab|
|00001280| 65 6c 3e 20 3a 74 65 78 | 74 20 22 48 65 6c 6c 6f |el> :tex|t "Hello|
|00001290| 20 77 6f 72 6c 64 22 20 | 0a 20 20 20 20 20 20 20 | world" |. |
|000012a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000012b0| 20 20 20 20 20 3a 62 61 | 63 6b 67 72 6f 75 6e 64 | :ba|ckground|
|000012c0| 20 22 43 68 6f 63 6f 6c | 61 74 65 22 29 29 0a 5c | "Chocol|ate")).\|
|000012d0| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0a 5c 65 |end{verb|atim}.\e|
|000012e0| 6e 64 7b 71 75 6f 74 65 | 7d 0a 0a 5c 73 65 63 74 |nd{quote|}..\sect|
|000012f0| 69 6f 6e 7b 43 6c 61 73 | 73 20 48 69 65 72 61 72 |ion{Clas|s Hierar|
|00001300| 63 68 79 7d 0a 0a 7b 5c | 73 74 6b 6c 6f 73 7d 20 |chy}..{\|stklos} |
|00001310| 54 6b 20 63 6c 61 73 73 | 65 73 20 70 65 72 6d 69 |Tk class|es permi|
|00001320| 74 20 74 6f 20 7b 5c 65 | 6d 20 72 65 69 66 79 7d |t to {\e|m reify}|
|00001330| 20 74 68 65 20 54 6b 20 | 77 69 64 67 65 74 73 20 | the Tk |widgets |
|00001340| 69 6e 74 6f 20 7b 5c 73 | 74 6b 6c 6f 73 0a 6f 62 |into {\s|tklos.ob|
|00001350| 6a 65 63 74 73 7d 2e 20 | 49 74 20 6d 65 61 6e 73 |jects}. |It means|
|00001360| 20 74 68 61 74 20 65 76 | 65 72 79 20 67 72 61 70 | that ev|ery grap|
|00001370| 68 69 63 61 6c 20 6f 62 | 6a 65 63 74 20 75 73 65 |hical ob|ject use|
|00001380| 64 20 69 6e 20 61 20 70 | 72 6f 67 72 61 6d 20 73 |d in a p|rogram s|
|00001390| 75 63 68 20 61 73 20 61 | 0a 6d 65 6e 75 2c 20 61 |uch as a|.menu, a|
|000013a0| 20 6c 61 62 65 6c 20 6f | 72 20 61 20 62 75 74 74 | label o|r a butt|
|000013b0| 6f 6e 20 69 73 20 72 65 | 70 72 65 73 65 6e 74 65 |on is re|presente|
|000013c0| 64 20 61 73 20 61 20 7b | 5c 73 74 6b 6c 6f 73 7d |d as a {|\stklos}|
|000013d0| 20 6f 62 6a 65 63 74 2e | 20 41 6c 6c 20 74 68 65 | object.| All the|
|000013e0| 0a 64 65 66 69 6e 65 64 | 20 7b 5c 73 74 6b 6c 6f |.defined| {\stklo|
|000013f0| 73 7d 20 63 6c 61 73 73 | 65 73 20 62 75 69 6c 64 |s} class|es build|
|00001400| 20 61 20 68 69 65 72 61 | 72 63 68 79 20 77 68 69 | a hiera|rchy whi|
|00001410| 63 68 20 69 73 20 62 72 | 69 65 66 6c 79 20 64 65 |ch is br|iefly de|
|00001420| 73 63 72 69 62 65 64 0a | 68 65 72 65 2e 20 46 69 |scribed.|here. Fi|
|00001430| 72 73 74 6c 79 2c 20 61 | 6c 6c 20 74 68 65 20 63 |rstly, a|ll the c|
|00001440| 6c 61 73 73 65 73 20 73 | 68 61 72 65 64 20 61 20 |lasses s|hared a |
|00001450| 75 6e 69 71 75 65 20 61 | 6e 63 65 73 74 6f 72 3a |unique a|ncestor:|
|00001460| 20 74 68 65 20 7b 5c 74 | 74 20 3c 54 6b 2d 6f 62 | the {\t|t <Tk-ob|
|00001470| 6a 65 63 74 3e 7d 0a 63 | 6c 61 73 73 2e 20 49 6e |ject>}.c|lass. In|
|00001480| 73 74 61 6e 63 65 73 20 | 6f 66 20 74 68 69 73 20 |stances |of this |
|00001490| 63 6c 61 73 73 20 63 6f | 6e 74 61 69 6e 20 69 6e |class co|ntain in|
|000014a0| 66 6f 72 6d 61 74 69 6f | 6e 73 20 77 68 69 63 68 |formatio|ns which|
|000014b0| 20 61 72 65 20 6e 65 63 | 65 73 73 61 72 79 20 66 | are nec|essary f|
|000014c0| 6f 72 0a 65 73 74 61 62 | 6c 69 73 68 69 6e 67 20 |or.estab|lishing |
|000014d0| 61 20 63 6f 6d 6d 75 6e | 69 63 61 74 69 6f 6e 20 |a commun|ication |
|000014e0| 62 65 74 77 65 65 6e 20 | 74 68 65 20 53 63 68 65 |between |the Sche|
|000014f0| 6d 65 20 61 6e 64 20 54 | 6b 20 77 6f 72 6c 64 73 |me and T|k worlds|
|00001500| 2e 20 50 72 69 6e 63 69 | 70 61 6c 6c 79 2c 0a 6f |. Princi|pally,.o|
|00001510| 62 6a 65 63 74 73 20 6f | 66 20 74 68 69 73 20 63 |bjects o|f this c|
|00001520| 6c 61 73 73 20 68 61 76 | 65 20 74 68 65 20 74 68 |lass hav|e the th|
|00001530| 72 65 65 20 73 6c 6f 74 | 73 20 63 69 74 65 64 20 |ree slot|s cited |
|00001540| 62 65 66 6f 72 65 20 7b | 5c 74 74 20 49 64 5c 69 |before {|\tt Id\i|
|00001550| 6e 64 65 78 7b 49 64 0a | 73 6c 6f 74 7d 7d 2c 20 |ndex{Id.|slot}}, |
|00001560| 7b 5c 74 74 20 45 69 64 | 5c 69 6e 64 65 78 7b 45 |{\tt Eid|\index{E|
|00001570| 69 64 20 73 6c 6f 74 7d | 7d 20 61 6e 64 20 7b 5c |id slot}|} and {\|
|00001580| 74 74 20 70 61 72 65 6e | 74 5c 69 6e 64 65 78 7b |tt paren|t\index{|
|00001590| 70 61 72 65 6e 74 20 73 | 6c 6f 74 7d 7d 2e 20 54 |parent s|lot}}. T|
|000015a0| 68 65 0a 7b 5c 74 74 20 | 49 64 7d 20 73 6c 6f 74 |he.{\tt |Id} slot|
|000015b0| 20 63 6f 6e 74 61 69 6e | 73 20 61 20 54 6b 20 63 | contain|s a Tk c|
|000015c0| 6f 6d 6d 61 6e 64 20 5c | 63 69 74 65 7b 53 54 6b |ommand \|cite{STk|
|000015d0| 2d 72 65 66 2d 6d 61 6e | 7d 2c 20 67 65 6e 65 72 |-ref-man|}, gener|
|000015e0| 61 74 65 64 20 62 79 0a | 7b 5c 73 74 6b 6c 6f 73 |ated by.|{\stklos|
|000015f0| 7d 20 69 74 73 65 6c 66 | 2c 20 77 68 69 63 68 20 |} itself|, which |
|00001600| 63 6f 72 72 65 73 70 6f | 6e 64 20 74 6f 20 74 68 |correspo|nd to th|
|00001610| 65 20 7b 5c 73 74 6b 7d | 20 63 6f 6d 6d 61 6e 64 |e {\stk}| command|
|00001620| 20 77 68 69 63 68 20 69 | 6d 70 6c 65 6d 65 6e 74 | which i|mplement|
|00001630| 20 74 68 65 0a 6f 62 6a | 65 63 74 2e 20 20 54 68 | the.obj|ect. Th|
|00001640| 65 20 7b 5c 74 74 20 70 | 61 72 65 6e 74 7d 20 73 |e {\tt p|arent} s|
|00001650| 6c 6f 74 20 63 6f 6e 74 | 61 69 6e 73 20 61 20 72 |lot cont|ains a r|
|00001660| 65 66 65 72 65 6e 63 65 | 20 74 6f 20 74 68 65 20 |eference| to the |
|00001670| 6f 62 6a 65 63 74 20 77 | 68 69 63 68 0a 28 67 72 |object w|hich.(gr|
|00001680| 61 70 68 69 63 61 6c 6c | 79 29 20 69 6e 63 6c 75 |aphicall|y) inclu|
|00001690| 64 65 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 6f |de the c|urrent o|
|000016a0| 62 6a 65 63 74 2e 20 54 | 68 69 73 20 73 6c 6f 74 |bject. T|his slot|
|000016b0| 20 77 69 6c 6c 20 62 65 | 20 64 69 73 63 75 73 73 | will be| discuss|
|000016c0| 65 64 20 6c 61 74 65 72 | 2e 0a 4e 6f 72 6d 61 6c |ed later|..Normal|
|000016d0| 6c 79 2c 20 65 6e 64 20 | 75 73 65 72 73 20 77 69 |ly, end |users wi|
|000016e0| 6c 6c 20 6e 6f 74 20 68 | 61 76 65 20 74 6f 20 75 |ll not h|ave to u|
|000016f0| 73 65 20 64 69 72 65 63 | 74 20 69 6e 73 74 61 6e |se direc|t instan|
|00001700| 63 65 73 20 6f 66 20 74 | 68 65 20 7b 5c 74 74 0a |ces of t|he {\tt.|
|00001710| 3c 54 6b 2d 6f 62 6a 65 | 63 74 3e 7d 20 63 6c 61 |<Tk-obje|ct>} cla|
|00001720| 73 73 5c 66 6f 6f 74 6e | 6f 74 65 7b 41 6c 6c 20 |ss\footn|ote{All |
|00001730| 63 6c 61 73 73 65 73 20 | 77 68 6f 73 65 20 6e 61 |classes |whose na|
|00001740| 6d 65 20 62 65 67 69 6e | 20 77 69 74 68 20 74 68 |me begin| with th|
|00001750| 65 20 60 60 54 6b 2d 27 | 27 0a 70 72 65 66 69 78 |e ``Tk-'|'.prefix|
|00001760| 20 61 72 65 20 6e 6f 74 | 20 61 72 65 20 6e 6f 74 | are not| are not|
|00001770| 20 69 6e 74 65 6e 64 65 | 64 20 66 6f 72 20 74 68 | intende|d for th|
|00001780| 65 20 66 69 6e 61 6c 20 | 75 73 65 72 2e 20 54 68 |e final |user. Th|
|00001790| 65 79 20 77 69 6c 6c 20 | 62 65 20 64 69 73 63 75 |ey will |be discu|
|000017a0| 73 73 65 64 20 69 6e 0a | 74 68 69 73 20 64 6f 63 |ssed in.|this doc|
|000017b0| 75 6d 65 6e 74 20 6f 6e | 6c 79 20 69 66 20 69 74 |ument on|ly if it|
|000017c0| 20 73 65 65 6d 73 20 6e | 65 63 65 73 73 61 72 79 | seems n|ecessary|
|000017d0| 20 66 6f 72 20 61 20 67 | 6f 6f 64 20 63 6c 61 73 | for a g|ood clas|
|000017e0| 73 20 68 69 65 72 61 72 | 63 68 79 0a 63 6f 6d 70 |s hierar|chy.comp|
|000017f0| 72 65 68 65 6e 73 69 6f | 6e 2e 7d 2e 0a 0a 54 68 |rehensio|n.}...Th|
|00001800| 65 20 6e 65 78 74 20 6c | 65 76 65 6c 20 69 6e 20 |e next l|evel in |
|00001810| 6f 75 72 20 63 6c 61 73 | 73 20 68 69 65 72 61 72 |our clas|s hierar|
|00001820| 63 68 79 20 64 65 66 69 | 6e 65 20 61 20 66 6f 72 |chy defi|ne a for|
|00001830| 6b 20 77 69 74 68 20 74 | 77 6f 20 62 72 61 6e 63 |k with t|wo branc|
|00001840| 68 65 73 3a 20 74 68 65 | 0a 7b 5c 74 74 20 3c 54 |hes: the|.{\tt <T|
|00001850| 6b 2d 77 69 64 67 65 74 | 3e 7d 5c 69 6e 64 65 78 |k-widget|>}\index|
|00001860| 7b 3c 54 6b 2d 77 69 64 | 67 65 74 3e 20 63 6c 61 |{<Tk-wid|get> cla|
|00001870| 73 73 7d 20 63 6c 61 73 | 73 20 61 6e 64 20 7b 5c |ss} clas|s and {\|
|00001880| 74 74 3c 54 6b 2d 63 61 | 6e 76 61 73 2d 69 74 65 |tt<Tk-ca|nvas-ite|
|00001890| 6d 3e 7d 0a 5c 69 6e 64 | 65 78 7b 3c 54 6b 2d 63 |m>}.\ind|ex{<Tk-c|
|000018a0| 61 6e 76 61 73 2d 69 74 | 65 6d 3e 20 63 6c 61 73 |anvas-it|em> clas|
|000018b0| 73 7d 20 63 6c 61 73 73 | 2e 20 49 6e 73 74 61 6e |s} class|. Instan|
|000018c0| 63 65 73 20 6f 66 20 74 | 68 65 0a 66 6f 72 6d 65 |ces of t|he.forme|
|000018d0| 72 20 63 6c 61 73 73 20 | 61 72 65 20 63 6c 61 73 |r class |are clas|
|000018e0| 73 69 63 61 6c 20 77 69 | 64 67 65 74 73 20 73 75 |sical wi|dgets su|
|000018f0| 63 68 20 61 73 20 62 75 | 74 74 6f 6e 73 2c 20 6d |ch as bu|ttons, m|
|00001900| 65 6e 75 73 20 6f 72 20 | 63 61 6e 76 61 73 65 73 |enus or |canvases|
|00001910| 20 73 69 6e 63 65 0a 69 | 6e 73 74 61 6e 63 65 73 | since.i|nstances|
|00001920| 20 6f 66 20 74 68 65 20 | 6c 61 74 65 72 20 61 72 | of the |later ar|
|00001930| 65 20 6f 62 6a 65 63 74 | 73 20 63 6f 6e 74 61 69 |e object|s contai|
|00001940| 6e 65 64 20 69 6e 20 61 | 20 63 61 6e 76 61 73 20 |ned in a| canvas |
|00001950| 73 75 63 68 20 61 73 20 | 6c 69 6e 65 73 20 6f 72 |such as |lines or|
|00001960| 0a 72 65 63 74 61 6e 67 | 6c 65 73 2e 20 20 7b 5c |.rectang|les. {\|
|00001970| 74 74 20 3c 54 6b 2d 77 | 69 64 67 65 74 3e 7d 73 |tt <Tk-w|idget>}s|
|00001980| 20 61 72 65 20 61 6c 73 | 6f 20 64 69 76 69 64 65 | are als|o divide|
|00001990| 64 20 69 6e 20 74 77 6f | 20 63 61 74 65 67 6f 72 |d in two| categor|
|000019a0| 69 65 73 3a 20 7b 5c 74 | 74 0a 3c 54 6b 2d 73 69 |ies: {\t|t.<Tk-si|
|000019b0| 6d 70 6c 65 2d 77 69 64 | 67 65 74 3e 7d 73 20 61 |mple-wid|get>}s a|
|000019c0| 6e 64 20 7b 5c 74 74 20 | 3c 54 6b 2d 63 6f 6d 70 |nd {\tt |<Tk-comp|
|000019d0| 6f 73 69 74 65 2d 77 69 | 64 67 65 74 3e 7d 73 2e |osite-wi|dget>}s.|
|000019e0| 20 53 69 6d 70 6c 65 73 | 20 77 69 64 67 65 74 73 | Simples| widgets|
|000019f0| 20 61 72 65 0a 64 69 72 | 65 63 74 6c 79 20 69 6d | are.dir|ectly im|
|00001a00| 70 6c 65 6d 65 6e 74 65 | 64 20 61 73 20 54 6b 20 |plemente|d as Tk |
|00001a10| 6f 62 6a 65 63 74 73 20 | 61 6e 64 20 63 6f 6d 70 |objects |and comp|
|00001a20| 6f 73 69 74 65 20 6f 6e | 65 73 20 61 72 65 20 62 |osite on|es are b|
|00001a30| 75 69 6c 64 20 75 70 6f | 6e 20 73 69 6d 70 6c 65 |uild upo|n simple|
|00001a40| 0a 77 69 64 67 65 74 73 | 20 28 65 2e 67 2e 20 66 |.widgets| (e.g. f|
|00001a50| 69 6c 65 20 62 72 6f 77 | 73 65 72 2c 20 61 6c 65 |ile brow|ser, ale|
|00001a60| 72 74 20 6d 65 73 73 61 | 67 65 73 20 61 6e 64 20 |rt messa|ges and |
|00001a70| 73 6f 20 6f 6e 29 2e 20 | 54 68 65 20 68 65 61 64 |so on). |The head|
|00001a80| 20 6f 66 20 74 68 65 0a | 7b 5c 73 74 6b 6c 6f 73 | of the.|{\stklos|
|00001a90| 7d 20 68 69 65 72 61 72 | 63 68 79 20 69 73 20 73 |} hierar|chy is s|
|00001aa0| 68 6f 77 6e 20 69 6e 20 | 46 69 67 75 72 65 20 5c |hown in |Figure \|
|00001ab0| 72 65 66 7b 48 65 61 64 | 2d 68 69 65 72 61 72 63 |ref{Head|-hierarc|
|00001ac0| 68 79 7d 2e 0a 5c 62 65 | 67 69 6e 7b 66 69 67 75 |hy}..\be|gin{figu|
|00001ad0| 72 65 7d 0a 25 5c 63 65 | 6e 74 65 72 6c 69 6e 65 |re}.%\ce|nterline|
|00001ae0| 7b 5c 65 70 73 66 69 67 | 7b 66 69 67 75 72 65 3d |{\epsfig|{figure=|
|00001af0| 7b 46 69 67 31 2d 31 2e | 69 64 72 61 77 7d 2c 68 |{Fig1-1.|idraw},h|
|00001b00| 65 69 67 68 74 3d 7b 32 | 2e 30 30 69 6e 7d 2c 77 |eight={2|.00in},w|
|00001b10| 69 64 74 68 3d 7b 32 2e | 30 30 69 6e 7d 7d 7d 0a |idth={2.|00in}}}.|
|00001b20| 5c 63 65 6e 74 65 72 6c | 69 6e 65 7b 5c 65 70 73 |\centerl|ine{\eps|
|00001b30| 66 69 67 7b 66 69 6c 65 | 3d 7b 46 69 67 31 2d 31 |fig{file|={Fig1-1|
|00001b40| 2e 65 70 73 7d 7d 7d 0a | 5c 63 61 70 74 69 6f 6e |.eps}}}.|\caption|
|00001b50| 7b 48 65 61 64 20 6f 66 | 20 74 68 65 20 7b 5c 73 |{Head of| the {\s|
|00001b60| 74 6b 6c 6f 73 7d 20 68 | 69 65 72 61 72 63 68 79 |tklos} h|ierarchy|
|00001b70| 7d 0a 5c 6c 61 62 65 6c | 7b 48 65 61 64 2d 68 69 |}.\label|{Head-hi|
|00001b80| 65 72 61 72 63 68 79 7d | 0a 5c 65 6e 64 7b 66 69 |erarchy}|.\end{fi|
|00001b90| 67 75 72 65 7d 0a 0a 5c | 73 75 62 73 65 63 74 69 |gure}..\|subsecti|
|00001ba0| 6f 6e 7b 54 68 65 20 7b | 5c 74 74 20 3c 54 6b 2d |on{The {|\tt <Tk-|
|00001bb0| 77 69 64 67 65 74 3e 7d | 20 63 6c 61 73 73 7d 0a |widget>}| class}.|
|00001bc0| 0a 4e 6f 20 73 6c 6f 74 | 20 69 73 20 64 65 66 69 |.No slot| is defi|
|00001bd0| 6e 65 64 20 66 6f 72 20 | 74 68 69 73 20 63 6c 61 |ned for |this cla|
|00001be0| 73 73 2e 20 48 6f 77 65 | 76 65 72 2c 20 73 69 6e |ss. Howe|ver, sin|
|00001bf0| 63 65 20 74 68 69 73 20 | 63 6c 61 73 73 20 69 73 |ce this |class is|
|00001c00| 20 63 6f 6d 6d 6f 6e 20 | 74 6f 20 61 6c 6c 0a 74 | common |to all.t|
|00001c10| 68 65 20 69 6e 74 65 72 | 66 61 63 65 20 6f 62 6a |he inter|face obj|
|00001c20| 65 63 74 73 20 28 6d 65 | 6e 75 73 2c 20 62 75 74 |ects (me|nus, but|
|00001c30| 74 6f 6e 73 2c 20 6c 61 | 62 65 6c 2c 20 5c 6c 64 |tons, la|bel, \ld|
|00001c40| 6f 74 73 29 2c 20 69 74 | 20 70 65 72 6d 69 74 73 |ots), it| permits|
|00001c50| 20 74 6f 20 64 65 66 69 | 6e 65 0a 74 68 65 69 72 | to defi|ne.their|
|00001c60| 20 63 6f 6d 6d 6f 6e 20 | 62 65 68 61 76 69 6f 72 | common |behavior|
|00001c70| 2e 20 54 68 65 20 62 65 | 68 61 76 69 6f 72 20 6f |. The be|havior o|
|00001c80| 66 20 74 68 6f 73 65 20 | 6f 62 6a 65 63 74 73 20 |f those |objects |
|00001c90| 69 73 20 64 65 73 63 72 | 69 62 65 64 20 75 73 69 |is descr|ibed usi|
|00001ca0| 6e 67 0a 7b 5c 73 74 6b | 6c 6f 73 7d 20 6d 65 74 |ng.{\stk|los} met|
|00001cb0| 68 6f 64 73 20 77 69 74 | 68 20 6f 6e 65 20 6f 66 |hods wit|h one of|
|00001cc0| 20 74 68 65 69 72 20 61 | 72 67 75 6d 65 6e 74 20 | their a|rgument |
|00001cd0| 28 67 65 6e 65 72 61 6c | 6c 79 20 74 68 65 20 66 |(general|ly the f|
|00001ce0| 69 72 73 74 29 20 77 68 | 69 63 68 20 69 73 20 61 |irst) wh|ich is a|
|00001cf0| 0a 7b 5c 74 74 20 3c 54 | 6b 2d 77 69 64 67 65 74 |.{\tt <T|k-widget|
|00001d00| 3e 7d 2e 20 54 68 65 20 | 7b 5c 65 6d 20 70 61 63 |>}. The |{\em pac|
|00001d10| 6b 5c 69 6e 64 65 78 7b | 70 61 63 6b 7d 7d 20 67 |k\index{|pack}} g|
|00001d20| 65 6f 6d 65 74 72 79 20 | 6d 61 6e 61 67 65 72 20 |eometry |manager |
|00001d30| 63 69 74 65 64 20 62 65 | 6c 6f 77 20 69 73 0a 6f |cited be|low is.o|
|00001d40| 6e 65 20 6f 66 20 73 75 | 63 68 20 6d 65 74 68 6f |ne of su|ch metho|
|00001d50| 64 73 2e 20 54 68 65 20 | 7b 5c 65 6d 20 70 61 63 |ds. The |{\em pac|
|00001d60| 6b 65 72 7d 20 77 69 6c | 6c 20 62 65 20 66 75 6c |ker} wil|l be ful|
|00001d70| 6c 79 20 64 65 73 63 72 | 69 62 65 64 20 62 65 6c |ly descr|ibed bel|
|00001d80| 6f 77 20 28 73 65 65 0a | 5c 70 61 67 65 72 65 66 |ow (see.|\pageref|
|00001d90| 7b 70 61 63 6b 65 72 2d | 64 6f 63 7d 29 3b 20 68 |{packer-|doc}); h|
|00001da0| 6f 77 65 76 65 72 2c 20 | 62 72 69 65 66 6c 79 20 |owever, |briefly |
|00001db0| 73 74 61 74 65 64 2c 20 | 77 65 20 63 61 6e 20 73 |stated, |we can s|
|00001dc0| 61 79 20 74 68 61 74 20 | 69 74 20 70 65 72 6d 69 |ay that |it permi|
|00001dd0| 74 73 20 74 6f 0a 65 78 | 70 6c 61 69 6e 20 74 68 |ts to.ex|plain th|
|00001de0| 65 20 67 65 6f 6d 65 74 | 72 79 20 6f 66 20 61 20 |e geomet|ry of a |
|00001df0| 77 69 64 67 65 74 20 64 | 65 70 65 6e 64 69 6e 67 |widget d|epending|
|00001e00| 20 6f 66 20 69 74 73 20 | 6e 65 69 67 68 62 6f 72 | of its |neighbor|
|00001e10| 73 2e 20 20 54 68 65 20 | 65 78 61 6d 70 6c 65 20 |s. The |example |
|00001e20| 62 65 6c 6f 77 0a 73 68 | 6f 77 73 20 68 6f 77 20 |below.sh|ows how |
|00001e30| 74 6f 20 75 73 65 20 74 | 68 65 20 70 61 63 6b 20 |to use t|he pack |
|00001e40| 70 72 69 6d 69 74 69 76 | 65 20 77 69 74 68 20 61 |primitiv|e with a|
|00001e50| 72 67 75 6d 65 6e 74 73 | 2e 0a 5c 62 65 67 69 6e |rguments|..\begin|
|00001e60| 7b 71 75 6f 74 65 7d 0a | 5c 62 65 67 69 6e 7b 76 |{quote}.|\begin{v|
|00001e70| 65 72 62 61 74 69 6d 7d | 0a 28 64 65 66 69 6e 65 |erbatim}|.(define|
|00001e80| 20 6c 61 62 31 20 28 6d | 61 6b 65 20 3c 4c 61 62 | lab1 (m|ake <Lab|
|00001e90| 65 6c 3e 20 3a 74 65 78 | 74 20 22 4c 61 62 65 6c |el> :tex|t "Label|
|00001ea0| 20 31 22 29 29 0a 28 64 | 65 66 69 6e 65 20 6c 61 | 1")).(d|efine la|
|00001eb0| 62 32 20 28 6d 61 6b 65 | 20 3c 4c 61 62 65 6c 3e |b2 (make| <Label>|
|00001ec0| 20 3a 74 65 78 74 20 22 | 4c 61 62 65 6c 20 32 22 | :text "|Label 2"|
|00001ed0| 29 29 0a 0a 28 70 61 63 | 6b 20 6c 61 62 31 20 3a |))..(pac|k lab1 :|
|00001ee0| 73 69 64 65 20 22 62 6f | 74 74 6f 6d 22 29 0a 28 |side "bo|ttom").(|
|00001ef0| 70 61 63 6b 20 6c 61 62 | 32 20 3a 73 69 64 65 20 |pack lab|2 :side |
|00001f00| 22 74 6f 70 22 20 3a 65 | 78 70 61 6e 64 20 23 74 |"top" :e|xpand #t|
|00001f10| 20 3a 66 69 6c 6c 20 22 | 62 6f 74 68 22 29 0a 5c | :fill "|both").\|
|00001f20| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0a 5c 65 |end{verb|atim}.\e|
|00001f30| 6e 64 7b 71 75 6f 74 65 | 7d 0a 0a 48 65 72 65 2c |nd{quote|}..Here,|
|00001f40| 20 74 77 6f 20 6c 61 62 | 65 6c 73 20 61 72 65 20 | two lab|els are |
|00001f50| 64 65 66 69 6e 65 64 20 | 7b 5c 74 74 20 6c 61 62 |defined |{\tt lab|
|00001f60| 31 7d 20 61 6e 64 20 7b | 5c 74 74 20 6c 61 62 32 |1} and {|\tt lab2|
|00001f70| 7d 2e 20 54 68 65 20 66 | 69 72 73 74 20 63 61 6c |}. The f|irst cal|
|00001f80| 6c 20 74 6f 0a 70 61 63 | 6b 20 73 61 79 73 20 74 |l to.pac|k says t|
|00001f90| 68 61 74 20 7b 5c 74 74 | 20 6c 61 62 31 7d 20 73 |hat {\tt| lab1} s|
|00001fa0| 68 6f 75 6c 64 20 6f 63 | 63 75 70 79 20 74 68 65 |hould oc|cupy the|
|00001fb0| 20 62 6f 74 74 6f 6d 20 | 6f 66 20 74 68 65 20 77 | bottom |of the w|
|00001fc0| 69 6e 64 6f 77 2e 20 53 | 65 63 6f 6e 64 0a 63 61 |indow. S|econd.ca|
|00001fd0| 6c 6c 20 73 74 61 74 65 | 73 20 74 68 61 74 20 7b |ll state|s that {|
|00001fe0| 5c 74 74 20 6c 61 62 32 | 7d 20 77 69 6c 6c 20 6f |\tt lab2|} will o|
|00001ff0| 63 63 75 70 79 20 74 68 | 65 20 74 6f 70 20 6f 66 |ccupy th|e top of|
|00002000| 20 74 68 65 20 77 69 6e | 64 6f 77 2e 20 46 75 72 | the win|dow. Fur|
|00002010| 74 68 65 72 6d 6f 72 65 | 2c 0a 74 68 65 20 20 6f |thermore|,.the o|
|00002020| 70 74 69 6f 6e 73 20 7b | 5c 74 74 20 3a 65 78 70 |ptions {|\tt :exp|
|00002030| 61 6e 64 7d 20 61 6e 64 | 20 7b 5c 74 74 20 3a 66 |and} and| {\tt :f|
|00002040| 69 6c 6c 7d 20 73 70 65 | 63 69 66 69 65 64 20 64 |ill} spe|cified d|
|00002050| 75 72 69 6e 67 20 7b 5c | 74 74 20 6c 61 62 32 7d |uring {\|tt lab2}|
|00002060| 0a 70 61 63 6b 69 6e 67 | 20 74 65 6c 6c 73 20 74 |.packing| tells t|
|00002070| 6f 20 74 68 65 20 70 61 | 63 6b 65 72 20 74 68 61 |o the pa|cker tha|
|00002080| 74 20 69 74 73 20 67 65 | 6f 6d 65 74 72 79 20 6d |t its ge|ometry m|
|00002090| 75 73 74 20 62 65 20 61 | 64 6a 75 73 74 65 64 20 |ust be a|djusted |
|000020a0| 74 6f 20 66 69 6c 6c 20 | 61 6c 6c 0a 74 68 65 20 |to fill |all.the |
|000020b0| 73 70 61 63 65 20 69 66 | 20 69 74 73 20 63 6f 6e |space if| its con|
|000020c0| 74 61 69 6e 69 6e 67 20 | 77 69 6e 64 6f 77 20 69 |taining |window i|
|000020d0| 73 20 72 65 73 69 7a 65 | 64 2e 20 49 66 20 77 65 |s resize|d. If we|
|000020e0| 20 64 6f 20 6e 6f 77 20 | 0a 5c 62 65 67 69 6e 7b | do now |.\begin{|
|000020f0| 71 75 6f 74 65 7d 0a 5c | 62 65 67 69 6e 7b 76 65 |quote}.\|begin{ve|
|00002100| 72 62 61 74 69 6d 7d 0a | 28 64 65 66 69 6e 65 20 |rbatim}.|(define |
|00002110| 6c 61 62 33 20 28 6d 61 | 6b 65 20 3c 4c 61 62 65 |lab3 (ma|ke <Labe|
|00002120| 6c 3e 20 3a 74 65 78 74 | 20 22 4c 61 62 65 6c 20 |l> :text| "Label |
|00002130| 33 22 29 29 0a 28 70 61 | 63 6b 20 6c 61 62 33 20 |3")).(pa|ck lab3 |
|00002140| 3a 61 66 74 65 72 20 6c | 61 62 32 29 0a 5c 65 6e |:after l|ab2).\en|
|00002150| 64 7b 76 65 72 62 61 74 | 69 6d 7d 0a 5c 65 6e 64 |d{verbat|im}.\end|
|00002160| 7b 71 75 6f 74 65 7d 0a | 77 65 20 77 69 6c 6c 20 |{quote}.|we will |
|00002170| 64 65 66 69 6e 65 20 61 | 20 6e 65 77 20 6c 61 62 |define a| new lab|
|00002180| 65 6c 20 77 68 69 63 68 | 20 77 69 6c 6c 20 62 65 |el which| will be|
|00002190| 20 69 6e 73 65 72 74 65 | 64 20 62 65 74 77 65 65 | inserte|d betwee|
|000021a0| 6e 20 74 68 65 20 7b 5c | 74 74 20 6c 61 62 31 7d |n the {\|tt lab1}|
|000021b0| 20 61 6e 64 0a 7b 5c 74 | 74 20 6c 61 62 32 7d 20 | and.{\t|t lab2} |
|000021c0| 6c 61 62 65 6c 73 2e 20 | 20 4f 66 20 63 6f 75 72 |labels. | Of cour|
|000021d0| 73 65 2c 20 74 68 65 20 | 77 69 6e 64 6f 77 20 63 |se, the |window c|
|000021e0| 6f 6e 74 61 69 6e 69 6e | 67 20 74 68 65 20 74 77 |ontainin|g the tw|
|000021f0| 6f 20 6c 61 62 65 6c 73 | 20 20 77 69 6c 6c 0a 62 |o labels| will.b|
|00002200| 65 20 7b 5c 65 6d 20 61 | 75 74 6f 6d 61 67 69 63 |e {\em a|utomagic|
|00002210| 61 6c 6c 79 7d 20 72 65 | 73 69 7a 65 64 20 74 6f |ally} re|sized to|
|00002220| 20 74 61 6b 65 20 69 6e | 74 6f 20 61 63 63 6f 75 | take in|to accou|
|00002230| 6e 74 20 74 68 65 20 69 | 6e 73 65 72 74 69 6f 6e |nt the i|nsertion|
|00002240| 20 6f 66 20 74 68 65 20 | 74 68 69 72 64 2e 0a 0a | of the |third...|
|00002250| 57 69 6e 64 6f 77 73 20 | 63 61 6e 20 61 6c 73 6f |Windows |can also|
|00002260| 20 62 65 20 75 6e 6d 61 | 70 70 65 64 20 66 72 6f | be unma|pped fro|
|00002270| 6d 20 73 63 72 65 65 6e | 20 77 69 74 68 20 74 68 |m screen| with th|
|00002280| 65 20 7b 5c 74 74 0a 75 | 6e 70 61 63 6b 5c 69 6e |e {\tt.u|npack\in|
|00002290| 64 65 78 7b 75 6e 70 61 | 63 6b 7d 7d 20 6d 65 74 |dex{unpa|ck}} met|
|000022a0| 68 6f 64 2e 20 54 68 69 | 73 20 6d 65 74 68 6f 64 |hod. Thi|s method|
|000022b0| 20 74 65 6c 6c 73 20 7b | 5c 65 6d 20 70 61 63 6b | tells {|\em pack|
|000022c0| 7d 20 74 6f 20 73 75 73 | 70 65 6e 64 0a 67 65 6f |} to sus|pend.geo|
|000022d0| 6d 65 74 72 79 20 6d 61 | 6e 61 67 65 6d 65 6e 74 |metry ma|nagement|
|000022e0| 20 6f 66 20 74 68 65 20 | 73 70 65 63 69 66 69 65 | of the |specifie|
|000022f0| 64 20 77 69 6e 64 6f 77 | 2e 20 41 6e 6f 74 68 65 |d window|. Anothe|
|00002300| 72 20 63 61 6c 6c 20 74 | 6f 20 61 20 67 65 6f 6d |r call t|o a geom|
|00002310| 65 74 72 79 0a 6d 61 6e | 61 67 65 72 20 73 68 6f |etry.man|ager sho|
|00002320| 75 6c 64 20 62 65 20 75 | 73 65 64 20 74 6f 20 6d |uld be u|sed to m|
|00002330| 61 70 20 61 67 61 69 6e | 20 74 68 65 20 77 69 6e |ap again| the win|
|00002340| 64 6f 77 20 6f 6e 20 64 | 69 73 70 6c 61 79 2e 0a |dow on d|isplay..|
|00002350| 0a 53 75 70 70 6f 73 65 | 20 6e 6f 77 20 74 68 61 |.Suppose| now tha|
|00002360| 74 20 77 65 20 77 61 6e | 74 20 74 6f 20 64 65 6c |t we wan|t to del|
|00002370| 65 74 65 20 74 68 65 20 | 74 6f 70 20 6d 6f 73 74 |ete the |top most|
|00002380| 20 6c 61 62 65 6c 20 6f | 66 20 6f 75 72 20 70 72 | label o|f our pr|
|00002390| 65 76 69 6f 75 73 0a 77 | 69 6e 64 6f 77 20 28 69 |evious.w|indow (i|
|000023a0| 2e 65 2e 20 7b 5c 74 74 | 20 6c 61 62 32 7d 29 2e |.e. {\tt| lab2}).|
|000023b0| 20 0a 54 68 69 73 20 63 | 61 6e 20 62 65 20 64 6f | .This c|an be do|
|000023c0| 6e 65 20 77 69 74 68 20 | 74 68 65 20 7b 5c 74 74 |ne with |the {\tt|
|000023d0| 20 3c 54 6b 2d 77 69 64 | 67 65 74 3e 7d 20 6d 65 | <Tk-wid|get>} me|
|000023e0| 74 68 6f 64 20 7b 5c 74 | 74 20 64 65 73 74 72 6f |thod {\t|t destro|
|000023f0| 79 7d 20 61 73 0a 73 68 | 6f 77 6e 20 62 65 6c 6f |y} as.sh|own belo|
|00002400| 77 3a 20 0a 5c 62 65 67 | 69 6e 7b 71 75 6f 74 65 |w: .\beg|in{quote|
|00002410| 7d 0a 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |}.\begin|{verbati|
|00002420| 6d 7d 0a 28 64 65 73 74 | 72 6f 79 20 6c 61 62 32 |m}.(dest|roy lab2|
|00002430| 29 0a 5c 65 6e 64 7b 76 | 65 72 62 61 74 69 6d 7d |).\end{v|erbatim}|
|00002440| 0a 5c 65 6e 64 7b 71 75 | 6f 74 65 7d 0a 5c 6e 6f |.\end{qu|ote}.\no|
|00002450| 69 6e 64 65 6e 74 0a 48 | 65 72 65 2c 20 74 68 65 |indent.H|ere, the|
|00002460| 20 77 69 6e 64 6f 77 20 | 69 73 20 75 6e 6d 61 70 | window |is unmap|
|00002470| 70 65 64 20 66 72 6f 6d | 20 73 63 72 65 65 6e 20 |ped from| screen |
|00002480| 61 6e 64 20 64 65 66 69 | 6e 69 74 69 76 65 6c 79 |and defi|nitively|
|00002490| 20 64 65 73 74 72 6f 79 | 65 64 0a 28 69 2e 65 2e | destroy|ed.(i.e.|
|000024a0| 20 69 74 20 63 61 6e 6e | 6f 74 20 62 65 20 6d 61 | it cann|ot be ma|
|000024b0| 70 70 65 64 20 6f 6e 20 | 74 68 65 20 73 63 72 65 |pped on |the scre|
|000024c0| 65 6e 20 61 6e 79 6d 6f | 72 65 29 2e 20 54 65 63 |en anymo|re). Tec|
|000024d0| 68 6e 69 63 61 6c 6c 79 | 20 73 70 65 61 6b 69 6e |hnically| speakin|
|000024e0| 67 2c 20 74 68 65 0a 77 | 69 64 67 65 74 20 77 69 |g, the.w|idget wi|
|000024f0| 6c 6c 20 62 65 20 64 65 | 73 74 72 6f 79 65 64 20 |ll be de|stroyed |
|00002500| 61 6e 64 20 69 74 73 20 | 63 6c 61 73 73 20 77 69 |and its |class wi|
|00002510| 6c 6c 20 62 65 20 63 68 | 61 6e 67 65 64 20 74 6f |ll be ch|anged to|
|00002520| 20 74 68 65 20 73 70 65 | 63 69 61 6c 20 63 6c 61 | the spe|cial cla|
|00002530| 73 73 0a 7b 5c 74 74 20 | 3c 44 65 73 74 72 6f 79 |ss.{\tt |<Destroy|
|00002540| 65 64 2d 6f 62 6a 65 63 | 74 3e 7d 5c 69 6e 64 65 |ed-objec|t>}\inde|
|00002550| 78 7b 3c 44 65 73 74 72 | 6f 79 65 64 2d 6f 62 6a |x{<Destr|oyed-obj|
|00002560| 65 63 74 3e 7d 2e 0a 0a | 5c 70 61 72 61 67 72 61 |ect>}...|\paragra|
|00002570| 70 68 7b 5c 62 66 20 4e | 6f 74 65 3a 7d 20 44 65 |ph{\bf N|ote:} De|
|00002580| 73 74 72 6f 79 69 6e 67 | 20 74 68 65 20 72 6f 6f |stroying| the roo|
|00002590| 74 20 77 69 6e 64 6f 77 | 20 0a 28 7b 5c 74 74 20 |t window| .({\tt |
|000025a0| 2a 74 6f 70 2d 72 6f 6f | 74 2a 5c 69 6e 64 65 78 |*top-roo|t*\index|
|000025b0| 7b 2a 74 6f 70 2d 72 6f | 6f 74 2a 7d 7d 29 20 77 |{*top-ro|ot*}}) w|
|000025c0| 69 6c 6c 20 64 65 73 74 | 72 6f 79 20 74 68 65 20 |ill dest|roy the |
|000025d0| 72 6f 6f 74 20 77 69 6e | 64 6f 77 0a 61 6e 64 2c |root win|dow.and,|
|000025e0| 20 63 6f 6e 73 65 71 75 | 65 6e 74 6c 79 2c 20 74 | consequ|ently, t|
|000025f0| 68 65 20 69 6e 74 65 72 | 70 72 65 74 65 72 20 73 |he inter|preter s|
|00002600| 69 6e 63 65 20 69 74 20 | 61 73 20 6e 6f 74 68 69 |ince it |as nothi|
|00002610| 6e 67 20 6d 6f 72 65 20 | 74 6f 20 6d 61 6e 61 67 |ng more |to manag|
|00002620| 65 2e 0a 0a 5c 73 75 62 | 73 65 63 74 69 6f 6e 7b |e...\sub|section{|
|00002630| 54 68 65 20 7b 5c 74 74 | 20 3c 54 6b 2d 73 69 6d |The {\tt| <Tk-sim|
|00002640| 70 6c 65 2d 77 69 64 67 | 65 74 3e 7d 20 63 6c 61 |ple-widg|et>} cla|
|00002650| 73 73 7d 0a 0a 7b 5c 73 | 74 6b 6c 6f 73 7d 20 64 |ss}..{\s|tklos} d|
|00002660| 65 66 69 6e 65 73 20 61 | 20 63 6c 61 73 73 20 66 |efines a| class f|
|00002670| 6f 72 20 65 61 63 68 20 | 73 69 6d 70 6c 65 20 77 |or each |simple w|
|00002680| 69 64 67 65 74 73 20 28 | 73 75 63 68 20 61 73 20 |idgets (|such as |
|00002690| 6c 61 62 65 6c 73 2c 20 | 62 75 74 74 6f 6e 73 20 |labels, |buttons |
|000026a0| 6f 72 0a 6d 65 73 73 61 | 67 65 73 29 20 6f 66 20 |or.messa|ges) of |
|000026b0| 74 68 65 20 54 6b 20 6c | 69 62 72 61 72 79 2e 20 |the Tk l|ibrary. |
|000026c0| 54 68 65 20 7b 5c 74 74 | 20 3c 54 6b 2d 73 69 6d |The {\tt| <Tk-sim|
|000026d0| 70 6c 65 2d 77 69 64 67 | 65 74 3e 7d 20 63 6c 61 |ple-widg|et>} cla|
|000026e0| 73 73 20 64 65 66 69 6e | 65 73 20 73 6c 6f 74 73 |ss defin|es slots|
|000026f0| 0a 61 6e 64 20 6d 65 74 | 68 6f 64 73 20 77 68 69 |.and met|hods whi|
|00002700| 63 68 20 61 72 65 20 63 | 6f 6d 6d 6f 6e 20 74 6f |ch are c|ommon to|
|00002710| 20 61 6c 6c 20 74 68 6f | 73 65 20 6f 62 6a 65 63 | all tho|se objec|
|00002720| 74 73 2e 20 54 68 65 20 | 6d 61 69 6e 20 73 6c 6f |ts. The |main slo|
|00002730| 74 73 20 64 65 66 69 6e | 65 64 20 66 6f 72 0a 73 |ts defin|ed for.s|
|00002740| 69 6d 70 6c 65 20 77 69 | 64 67 65 74 73 20 61 72 |imple wi|dgets ar|
|00002750| 65 3a 0a 5c 62 65 67 69 | 6e 20 7b 69 70 7d 0a 5c |e:.\begi|n {ip}.\|
|00002760| 49 54 45 4d 7b 62 61 63 | 6b 67 72 6f 75 6e 64 7d |ITEM{bac|kground}|
|00002770| 5c 6c 61 62 65 6c 7b 62 | 61 63 6b 67 72 6f 75 6e |\label{b|ackgroun|
|00002780| 64 7d 0a 77 68 69 63 68 | 20 73 70 65 63 69 66 69 |d}.which| specifi|
|00002790| 65 73 0a 74 68 65 20 6e | 6f 72 6d 61 6c 20 62 61 |es.the n|ormal ba|
|000027a0| 63 6b 67 72 6f 75 6e 64 | 20 63 6f 6c 6f 72 20 74 |ckground| color t|
|000027b0| 6f 20 75 73 65 20 77 68 | 65 6e 20 64 69 73 70 6c |o use wh|en displ|
|000027c0| 61 79 69 6e 67 20 74 68 | 65 20 77 69 64 67 65 74 |aying th|e widget|
|000027d0| 2e 20 20 54 68 65 20 76 | 61 6c 75 65 20 6f 66 0a |. The v|alue of.|
|000027e0| 74 68 69 73 20 73 6c 6f | 74 20 73 68 6f 75 6c 64 |this slo|t should|
|000027f0| 20 62 65 20 61 20 7b 5c | 65 6d 20 73 74 72 69 6e | be a {\|em strin|
|00002800| 67 7d 20 6f 72 20 61 20 | 7b 5c 65 6d 20 73 79 6d |g} or a |{\em sym|
|00002810| 62 6f 6c 7d 2e 20 49 74 | 20 63 61 6e 20 62 65 20 |bol}. It| can be |
|00002820| 0a 5c 62 65 67 69 6e 7b | 69 74 65 6d 69 7a 65 7d |.\begin{|itemize}|
|00002830| 0a 5c 69 74 65 6d 20 61 | 20 74 65 78 74 75 61 6c |.\item a| textual|
|00002840| 20 6e 61 6d 65 0a 66 6f | 72 20 61 20 63 6f 6c 6f | name.fo|r a colo|
|00002850| 72 20 64 65 66 69 6e 65 | 64 20 69 6e 20 74 68 65 |r define|d in the|
|00002860| 20 73 65 72 76 65 72 27 | 73 20 63 6f 6c 6f 72 20 | server'|s color |
|00002870| 64 61 74 61 62 61 73 65 | 20 66 69 6c 65 20 28 65 |database| file (e|
|00002880| 2e 67 2e 20 22 43 68 6f | 63 6f 6c 61 74 65 22 20 |.g. "Cho|colate" |
|00002890| 6f 72 0a 22 44 61 72 6b | 20 4f 6c 69 76 65 20 47 |or."Dark| Olive G|
|000028a0| 72 65 65 6e 22 29 2e 0a | 5c 69 74 65 6d 20 61 20 |reen")..|\item a |
|000028b0| 6e 75 6d 65 72 69 63 20 | 73 70 65 63 69 66 69 63 |numeric |specific|
|000028c0| 61 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 72 65 64 |ation of| the red|
|000028d0| 2c 20 67 72 65 65 6e 2c | 20 61 6e 64 20 62 6c 75 |, green,| and blu|
|000028e0| 65 20 69 6e 74 65 6e 73 | 69 74 69 65 73 0a 74 6f |e intens|ities.to|
|000028f0| 20 75 73 65 20 74 6f 20 | 64 69 73 70 6c 61 79 20 | use to |display |
|00002900| 74 68 65 20 63 6f 6c 6f | 72 20 28 73 75 63 68 20 |the colo|r (such |
|00002910| 61 73 20 7b 5c 74 74 20 | 5c 23 61 61 62 62 63 63 |as {\tt |\#aabbcc|
|00002920| 7d 20 6f 72 20 65 76 65 | 6e 20 7b 5c 74 74 20 72 |} or eve|n {\tt r|
|00002930| 67 62 3a 61 61 2f 62 62 | 2f 63 63 7d 29 0a 75 73 |gb:aa/bb|/cc}).us|
|00002940| 69 6e 67 20 74 68 65 20 | 73 74 61 6e 64 61 72 64 |ing the |standard|
|00002950| 20 58 31 31 20 6e 6f 74 | 61 74 69 6f 6e 2e 0a 5c | X11 not|ation..\|
|00002960| 65 6e 64 7b 69 74 65 6d | 69 7a 65 7d 0a 0a 5c 49 |end{item|ize}..\I|
|00002970| 54 45 4d 7b 62 6f 72 64 | 65 72 2d 77 69 64 74 68 |TEM{bord|er-width|
|00002980| 7d 5c 6c 61 62 65 6c 7b | 62 6f 72 64 65 72 2d 77 |}\label{|border-w|
|00002990| 69 64 74 68 7d 0a 77 68 | 69 63 68 20 73 70 65 63 |idth}.wh|ich spec|
|000029a0| 69 66 69 65 73 20 61 20 | 6e 6f 6e 2d 6e 65 67 61 |ifies a |non-nega|
|000029b0| 74 69 76 65 20 76 61 6c | 75 65 20 69 6e 64 69 63 |tive val|ue indic|
|000029c0| 61 74 69 6e 67 20 74 68 | 65 20 77 69 64 74 68 20 |ating th|e width |
|000029d0| 6f 66 20 74 68 65 20 33 | 2d 44 20 62 6f 72 64 65 |of the 3|-D borde|
|000029e0| 72 20 74 6f 0a 64 72 61 | 77 20 61 72 6f 75 6e 64 |r to.dra|w around|
|000029f0| 20 74 68 65 20 6f 75 74 | 73 69 64 65 20 6f 66 20 | the out|side of |
|00002a00| 74 68 65 20 77 69 64 67 | 65 74 20 28 69 66 20 73 |the widg|et (if s|
|00002a10| 75 63 68 20 61 20 62 6f | 72 64 65 72 20 69 73 20 |uch a bo|rder is |
|00002a20| 62 65 69 6e 67 20 64 72 | 61 77 6e 3b 20 74 68 65 |being dr|awn; the|
|00002a30| 0a 7b 5c 65 6d 20 72 65 | 6c 69 65 66 7d 20 6f 70 |.{\em re|lief} op|
|00002a40| 74 69 6f 6e 20 74 79 70 | 69 63 61 6c 6c 79 20 64 |tion typ|ically d|
|00002a50| 65 74 65 72 6d 69 6e 65 | 73 20 74 68 69 73 29 2e |etermine|s this).|
|00002a60| 0a 0a 5c 49 54 45 4d 7b | 63 75 72 73 6f 72 7d 5c |..\ITEM{|cursor}\|
|00002a70| 6c 61 62 65 6c 7b 63 75 | 72 73 6f 72 7d 0a 77 68 |label{cu|rsor}.wh|
|00002a80| 69 63 68 20 73 70 65 63 | 69 66 69 65 73 20 74 68 |ich spec|ifies th|
|00002a90| 65 20 6d 6f 75 73 65 0a | 63 75 72 73 6f 72 20 74 |e mouse.|cursor t|
|00002aa0| 6f 20 62 65 20 75 73 65 | 64 20 66 6f 72 20 74 68 |o be use|d for th|
|00002ab0| 65 20 77 69 64 67 65 74 | 2e 20 56 61 6c 69 64 20 |e widget|. Valid |
|00002ac0| 76 61 6c 75 65 73 20 66 | 6f 72 20 74 68 69 73 20 |values f|or this |
|00002ad0| 73 6c 6f 74 20 61 72 65 | 20 67 69 76 65 6e 20 69 |slot are| given i|
|00002ae0| 6e 0a 54 61 62 6c 65 7e | 5c 72 65 66 7b 63 75 72 |n.Table~|\ref{cur|
|00002af0| 73 6f 72 2d 74 61 62 6c | 65 7d 2e 20 42 65 20 61 |sor-tabl|e}. Be a|
|00002b00| 77 61 72 65 20 74 68 61 | 74 20 63 61 73 65 20 69 |ware tha|t case i|
|00002b10| 73 20 73 69 67 6e 69 66 | 69 63 61 6e 74 20 77 68 |s signif|icant wh|
|00002b20| 65 6e 20 6e 61 6d 69 6e | 67 20 61 20 63 75 72 73 |en namin|g a curs|
|00002b30| 6f 72 2e 0a 0a 5c 49 54 | 45 4d 7b 72 65 6c 69 65 |or...\IT|EM{relie|
|00002b40| 66 7d 5c 6c 61 62 65 6c | 7b 72 65 6c 69 65 66 7d |f}\label|{relief}|
|00002b50| 0a 77 68 69 63 68 20 73 | 70 65 63 69 66 69 65 73 |.which s|pecifies|
|00002b60| 20 74 68 65 20 33 2d 44 | 0a 65 66 66 65 63 74 20 | the 3-D|.effect |
|00002b70| 64 65 73 69 72 65 64 20 | 66 6f 72 20 74 68 65 20 |desired |for the |
|00002b80| 77 69 64 67 65 74 2e 20 | 20 41 63 63 65 70 74 61 |widget. | Accepta|
|00002b90| 62 6c 65 20 76 61 6c 75 | 65 73 20 61 72 65 20 7b |ble valu|es are {|
|00002ba0| 5c 74 74 20 3a 72 61 69 | 73 65 64 7d 2c 20 7b 5c |\tt :rai|sed}, {\|
|00002bb0| 74 74 0a 3a 73 75 6e 6b | 65 6e 7d 2c 20 7b 5c 74 |tt.:sunk|en}, {\t|
|00002bc0| 74 20 3a 66 6c 61 74 7d | 2c 20 7b 5c 74 74 20 3a |t :flat}|, {\tt :|
|00002bd0| 72 69 64 67 65 7d 20 6f | 72 20 7b 5c 74 74 20 3a |ridge} o|r {\tt :|
|00002be0| 67 72 6f 6f 76 65 7d 2e | 20 20 54 68 65 20 76 61 |groove}.| The va|
|00002bf0| 6c 75 65 20 69 6e 64 69 | 63 61 74 65 73 20 68 6f |lue indi|cates ho|
|00002c00| 77 0a 74 68 65 20 69 6e | 74 65 72 69 6f 72 20 6f |w.the in|terior o|
|00002c10| 66 20 74 68 65 20 77 69 | 64 67 65 74 20 73 68 6f |f the wi|dget sho|
|00002c20| 75 6c 64 20 61 70 70 65 | 61 72 20 72 65 6c 61 74 |uld appe|ar relat|
|00002c30| 69 76 65 20 74 6f 20 69 | 74 73 20 65 78 74 65 72 |ive to i|ts exter|
|00002c40| 69 6f 72 3b 20 66 6f 72 | 0a 65 78 61 6d 70 6c 65 |ior; for|.example|
|00002c50| 2c 20 7b 5c 74 74 20 3a | 72 61 69 73 65 64 7d 20 |, {\tt :|raised} |
|00002c60| 6d 65 61 6e 73 20 74 68 | 65 20 69 6e 74 65 72 69 |means th|e interi|
|00002c70| 6f 72 20 6f 66 20 74 68 | 65 20 77 69 64 67 65 74 |or of th|e widget|
|00002c80| 20 73 68 6f 75 6c 64 20 | 61 70 70 65 61 72 20 74 | should |appear t|
|00002c90| 6f 0a 70 72 6f 74 72 75 | 64 65 20 66 72 6f 6d 20 |o.protru|de from |
|00002ca0| 74 68 65 20 73 63 72 65 | 65 6e 2c 20 72 65 6c 61 |the scre|en, rela|
|00002cb0| 74 69 76 65 20 74 6f 20 | 74 68 65 20 65 78 74 65 |tive to |the exte|
|00002cc0| 72 69 6f 72 20 6f 66 20 | 74 68 65 20 77 69 64 67 |rior of |the widg|
|00002cd0| 65 74 2e 0a 5c 65 6e 64 | 7b 69 70 7d 0a 5c 62 65 |et..\end|{ip}.\be|
|00002ce0| 67 69 6e 7b 74 61 62 6c | 65 7d 0a 7b 5c 66 6f 6f |gin{tabl|e}.{\foo|
|00002cf0| 74 6e 6f 74 65 73 69 7a | 65 0a 5c 62 65 67 69 6e |tnotesiz|e.\begin|
|00002d00| 7b 63 65 6e 74 65 72 7d | 0a 5c 62 65 67 69 6e 7b |{center}|.\begin{|
|00002d10| 74 61 62 75 6c 61 72 7d | 7b 7c 6c 7c 6c 7c 6c 7c |tabular}|{|l|l|l||
|00002d20| 6c 7c 7d 20 5c 68 6c 69 | 6e 65 0a 58 5c 5f 63 75 |l|} \hli|ne.X\_cu|
|00002d30| 72 73 6f 72 20 20 20 20 | 20 20 20 20 20 20 20 20 |rsor | |
|00002d40| 20 20 20 26 20 66 6c 65 | 75 72 20 20 20 20 20 20 | & fle|ur |
|00002d50| 20 20 20 20 20 20 20 20 | 20 20 20 26 20 73 61 69 | | & sai|
|00002d60| 6c 62 6f 61 74 20 20 20 | 20 20 20 5c 5c 0a 61 72 |lboat | \\.ar|
|00002d70| 72 6f 77 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |row | |
|00002d80| 20 20 20 20 20 20 26 20 | 67 6f 62 62 6c 65 72 20 | & |gobbler |
|00002d90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 26 20 | | & |
|00002da0| 73 62 5c 5f 64 6f 77 6e | 5c 5f 61 72 72 6f 77 20 |sb\_down|\_arrow |
|00002db0| 20 20 20 20 20 20 5c 5c | 0a 62 61 73 65 64 5c 5f | \\|.based\_|
|00002dc0| 61 72 72 6f 77 5c 5f 64 | 6f 77 6e 20 20 20 20 20 |arrow\_d|own |
|00002dd0| 20 26 20 67 75 6d 62 79 | 20 20 20 20 20 20 20 20 | & gumby| |
|00002de0| 20 20 20 20 20 20 20 20 | 20 26 20 73 62 5c 5f 68 | | & sb\_h|
|00002df0| 5c 5f 64 6f 75 62 6c 65 | 5c 5f 61 72 72 6f 77 20 |\_double|\_arrow |
|00002e00| 20 5c 5c 0a 62 61 73 65 | 64 5c 5f 61 72 72 6f 77 | \\.base|d\_arrow|
|00002e10| 5c 5f 75 70 20 20 20 20 | 20 20 20 20 20 20 20 20 |\_up | |
|00002e20| 20 20 20 20 26 20 68 61 | 6e 64 31 20 20 20 20 20 | & ha|nd1 |
|00002e30| 20 20 20 20 20 20 20 20 | 20 20 20 20 26 20 73 62 | | & sb|
|00002e40| 5c 5f 6c 65 66 74 5c 5f | 61 72 72 6f 77 20 20 20 |\_left\_|arrow |
|00002e50| 20 20 20 20 5c 5c 0a 62 | 6f 61 74 20 20 20 20 20 | \\.b|oat |
|00002e60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 26 | | &|
|00002e70| 20 68 61 6e 64 32 20 20 | 20 20 20 20 20 20 20 20 | hand2 | |
|00002e80| 20 20 20 20 20 20 20 26 | 20 73 62 5c 5f 72 69 67 | &| sb\_rig|
|00002e90| 68 74 5c 5f 61 72 72 6f | 77 20 20 20 20 20 20 5c |ht\_arro|w \|
|00002ea0| 5c 0a 62 6f 67 6f 73 69 | 74 79 20 20 20 20 20 20 |\.bogosi|ty |
|00002eb0| 20 20 20 20 20 20 20 20 | 20 20 26 20 68 65 61 72 | | & hear|
|00002ec0| 74 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |t | |
|00002ed0| 20 20 26 20 73 62 5c 5f | 75 70 5c 5f 61 72 72 6f | & sb\_|up\_arro|
|00002ee0| 77 20 5c 5c 0a 62 6f 74 | 74 6f 6d 5c 5f 6c 65 66 |w \\.bot|tom\_lef|
|00002ef0| 74 5c 5f 63 6f 72 6e 65 | 72 20 20 20 20 26 20 69 |t\_corne|r & i|
|00002f00| 63 6f 6e 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |con | |
|00002f10| 20 20 20 20 20 26 20 73 | 62 5c 5f 76 5c 5f 64 6f | & s|b\_v\_do|
|00002f20| 75 62 6c 65 5c 5f 61 72 | 72 6f 77 20 20 5c 5c 0a |uble\_ar|row \\.|
|00002f30| 62 6f 74 74 6f 6d 5c 5f | 72 69 67 68 74 5c 5f 63 |bottom\_|right\_c|
|00002f40| 6f 72 6e 65 72 20 20 20 | 26 20 69 72 6f 6e 5c 5f |orner |& iron\_|
|00002f50| 63 72 6f 73 73 20 20 20 | 20 20 20 20 20 20 20 20 |cross | |
|00002f60| 26 20 73 68 75 74 74 6c | 65 20 20 20 20 20 20 20 |& shuttl|e |
|00002f70| 5c 5c 0a 62 6f 74 74 6f | 6d 5c 5f 73 69 64 65 20 |\\.botto|m\_side |
|00002f80| 20 20 20 20 20 20 20 20 | 20 20 20 26 20 6c 65 66 | | & lef|
|00002f90| 74 5c 5f 70 74 72 20 20 | 20 20 20 20 20 20 20 20 |t\_ptr | |
|00002fa0| 20 20 20 26 20 73 69 7a | 69 6e 67 20 20 20 20 20 | & siz|ing |
|00002fb0| 20 20 20 5c 5c 0a 62 6f | 74 74 6f 6d 5c 5f 74 65 | \\.bo|ttom\_te|
|00002fc0| 65 20 20 20 20 20 20 20 | 20 20 20 20 20 20 26 20 |e | & |
|00002fd0| 6c 65 66 74 5c 5f 73 69 | 64 65 20 20 20 20 20 20 |left\_si|de |
|00002fe0| 20 20 20 20 20 20 26 20 | 73 70 69 64 65 72 20 20 | & |spider |
|00002ff0| 20 20 20 20 20 20 5c 5c | 0a 62 6f 78 5c 5f 73 70 | \\|.box\_sp|
|00003000| 69 72 61 6c 20 20 20 20 | 20 20 20 20 20 20 20 20 |iral | |
|00003010| 20 26 20 6c 65 66 74 5c | 5f 74 65 65 20 20 20 20 | & left\|_tee |
|00003020| 20 20 20 20 20 20 20 20 | 20 26 20 73 70 72 61 79 | | & spray|
|00003030| 63 61 6e 20 20 20 20 20 | 20 5c 5c 0a 63 65 6e 74 |can | \\.cent|
|00003040| 65 72 5c 5f 70 74 72 20 | 20 20 20 20 20 20 20 20 |er\_ptr | |
|00003050| 20 20 20 20 26 20 6c 65 | 66 74 62 75 74 74 6f 6e | & le|ftbutton|
|00003060| 20 20 20 20 20 20 20 20 | 20 20 20 20 26 20 73 74 | | & st|
|00003070| 61 72 20 20 5c 5c 0a 63 | 69 72 63 6c 65 20 20 20 |ar \\.c|ircle |
|00003080| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 26 | | &|
|00003090| 20 6c 6c 5c 5f 61 6e 67 | 6c 65 20 20 20 20 20 20 | ll\_ang|le |
|000030a0| 20 20 20 20 20 20 20 26 | 20 74 61 72 67 65 74 20 | &| target |
|000030b0| 20 20 20 20 20 20 20 5c | 5c 0a 63 6c 6f 63 6b 20 | \|\.clock |
|000030c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000030d0| 20 20 26 20 6c 72 5c 5f | 61 6e 67 6c 65 20 20 20 | & lr\_|angle |
|000030e0| 20 20 20 20 20 20 20 20 | 20 20 26 20 74 63 72 6f | | & tcro|
|000030f0| 73 73 20 20 20 20 20 20 | 20 20 5c 5c 0a 63 6f 66 |ss | \\.cof|
|00003100| 66 65 65 5c 5f 6d 75 67 | 20 20 20 20 20 20 20 20 |fee\_mug| |
|00003110| 20 20 20 20 20 26 20 6d | 61 6e 20 20 20 20 20 20 | & m|an |
|00003120| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 26 20 74 | | & t|
|00003130| 6f 70 5c 5f 6c 65 66 74 | 5c 5f 61 72 72 6f 77 20 |op\_left|\_arrow |
|00003140| 20 20 20 20 20 5c 5c 0a | 63 72 6f 73 73 20 20 20 | \\.|cross |
|00003150| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003160| 26 20 6d 69 64 64 6c 65 | 62 75 74 74 6f 6e 20 20 |& middle|button |
|00003170| 20 20 20 20 20 20 20 20 | 26 20 74 6f 70 5c 5f 6c | |& top\_l|
|00003180| 65 66 74 5c 5f 63 6f 72 | 6e 65 72 20 20 20 20 20 |eft\_cor|ner |
|00003190| 5c 5c 0a 63 72 6f 73 73 | 5c 5f 72 65 76 65 72 73 |\\.cross|\_revers|
|000031a0| 65 20 20 20 20 20 20 20 | 20 20 20 26 20 6d 6f 75 |e | & mou|
|000031b0| 73 65 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |se | |
|000031c0| 20 20 20 26 20 74 6f 70 | 5c 5f 72 69 67 68 74 5c | & top|\_right\|
|000031d0| 5f 63 6f 72 6e 65 72 20 | 20 20 20 5c 5c 0a 63 72 |_corner | \\.cr|
|000031e0| 6f 73 73 68 61 69 72 20 | 20 20 20 20 20 20 20 20 |osshair | |
|000031f0| 20 20 20 20 20 20 26 20 | 70 65 6e 63 69 6c 20 20 | & |pencil |
|00003200| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 26 20 | | & |
|00003210| 74 6f 70 5c 5f 73 69 64 | 65 20 20 20 20 20 5c 5c |top\_sid|e \\|
|00003220| 0a 64 69 61 6d 6f 6e 64 | 5c 5f 63 72 6f 73 73 20 |.diamond|\_cross |
|00003230| 20 20 20 20 20 20 20 20 | 20 26 20 70 69 72 61 74 | | & pirat|
|00003240| 65 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |e | |
|00003250| 20 26 20 74 6f 70 5c 5f | 74 65 65 20 20 20 20 20 | & top\_|tee |
|00003260| 20 5c 5c 0a 64 6f 74 20 | 20 20 20 20 20 20 20 20 | \\.dot | |
|00003270| 20 20 20 20 20 20 20 20 | 20 20 20 20 26 20 70 6c | | & pl|
|00003280| 75 73 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |us | |
|00003290| 20 20 20 20 26 20 74 72 | 65 6b 20 20 5c 5c 0a 64 | & tr|ek \\.d|
|000032a0| 6f 74 62 6f 78 20 20 20 | 20 20 20 20 20 20 20 20 |otbox | |
|000032b0| 20 20 20 20 20 20 20 26 | 20 71 75 65 73 74 69 6f | &| questio|
|000032c0| 6e 5c 5f 61 72 72 6f 77 | 20 20 20 20 20 20 20 26 |n\_arrow| &|
|000032d0| 20 75 6c 5c 5f 61 6e 67 | 6c 65 20 20 20 20 20 5c | ul\_ang|le \|
|000032e0| 5c 0a 64 6f 75 62 6c 65 | 5c 5f 61 72 72 6f 77 20 |\.double|\_arrow |
|000032f0| 20 20 20 20 20 20 20 20 | 20 20 26 20 72 69 67 68 | | & righ|
|00003300| 74 5c 5f 70 74 72 20 20 | 20 20 20 20 20 20 20 20 |t\_ptr | |
|00003310| 20 20 26 20 75 6d 62 72 | 65 6c 6c 61 20 20 20 20 | & umbr|ella |
|00003320| 20 20 5c 5c 0a 64 72 61 | 66 74 5c 5f 6c 61 72 67 | \\.dra|ft\_larg|
|00003330| 65 20 20 20 20 20 20 20 | 20 20 20 20 20 26 20 72 |e | & r|
|00003340| 69 67 68 74 5c 5f 73 69 | 64 65 20 20 20 20 20 20 |ight\_si|de |
|00003350| 20 20 20 20 20 26 20 75 | 72 5c 5f 61 6e 67 6c 65 | & u|r\_angle|
|00003360| 20 20 20 20 20 5c 5c 0a | 64 72 61 66 74 5c 5f 73 | \\.|draft\_s|
|00003370| 6d 61 6c 6c 20 20 20 20 | 20 20 20 20 20 20 20 20 |mall | |
|00003380| 26 20 72 69 67 68 74 5c | 5f 74 65 65 20 20 20 20 |& right\|_tee |
|00003390| 20 20 20 20 20 20 20 20 | 26 20 77 61 74 63 68 20 | |& watch |
|000033a0| 5c 5c 0a 64 72 61 70 65 | 64 5c 5f 62 6f 78 20 20 |\\.drape|d\_box |
|000033b0| 20 20 20 20 20 20 20 20 | 20 20 20 26 20 72 69 67 | | & rig|
|000033c0| 68 74 62 75 74 74 6f 6e | 20 20 20 20 20 20 20 20 |htbutton| |
|000033d0| 20 20 20 26 20 78 74 65 | 72 6d 20 5c 5c 0a 65 78 | & xte|rm \\.ex|
|000033e0| 63 68 61 6e 67 65 20 20 | 20 20 20 20 20 20 20 20 |change | |
|000033f0| 20 20 20 20 20 20 26 20 | 72 74 6c 5c 5f 6c 6f 67 | & |rtl\_log|
|00003400| 6f 20 20 20 20 20 20 20 | 20 20 20 20 20 20 26 20 |o | & |
|00003410| 7b 5c 20 7d 20 5c 5c 20 | 5c 68 6c 69 6e 65 20 0a |{\ } \\ |\hline .|
|00003420| 5c 65 6e 64 7b 74 61 62 | 75 6c 61 72 7d 0a 5c 65 |\end{tab|ular}.\e|
|00003430| 6e 64 7b 63 65 6e 74 65 | 72 7d 0a 7d 0a 5c 63 61 |nd{cente|r}.}.\ca|
|00003440| 70 74 69 6f 6e 20 7b 56 | 61 6c 69 64 20 63 75 72 |ption {V|alid cur|
|00003450| 73 6f 72 20 76 61 6c 75 | 65 73 20 66 6f 72 20 73 |sor valu|es for s|
|00003460| 6c 6f 74 20 7b 5c 74 74 | 20 63 75 72 73 6f 72 7d |lot {\tt| cursor}|
|00003470| 7d 0a 5c 6c 61 62 65 6c | 7b 63 75 72 73 6f 72 2d |}.\label|{cursor-|
|00003480| 74 61 62 6c 65 7d 0a 5c | 65 6e 64 7b 74 61 62 6c |table}.\|end{tabl|
|00003490| 65 7d 0a 54 68 65 73 65 | 20 73 6c 6f 74 73 20 61 |e}.These| slots a|
|000034a0| 72 65 20 64 65 66 69 6e | 65 64 20 66 6f 72 20 61 |re defin|ed for a|
|000034b0| 6c 6c 20 74 68 65 20 62 | 61 73 69 63 20 77 69 64 |ll the b|asic wid|
|000034c0| 67 65 74 73 20 6f 66 20 | 74 68 65 20 7b 5c 73 74 |gets of |the {\st|
|000034d0| 6b 6c 6f 73 7d 0a 70 61 | 63 6b 61 67 65 2e 20 48 |klos}.pa|ckage. H|
|000034e0| 6f 77 65 76 65 72 2c 20 | 74 68 65 79 20 61 72 65 |owever, |they are|
|000034f0| 20 6e 6f 74 20 64 65 66 | 69 6e 65 64 20 61 73 20 | not def|ined as |
|00003500| 72 65 61 6c 20 7b 5c 73 | 74 6b 6c 6f 73 7d 20 73 |real {\s|tklos} s|
|00003510| 6c 6f 74 73 20 28 69 2e | 65 2e 20 74 68 65 79 20 |lots (i.|e. they |
|00003520| 61 72 65 20 6e 6f 74 0a | 69 6d 70 6c 61 6e 74 65 |are not.|implante|
|00003530| 64 20 69 6e 20 74 68 65 | 20 53 63 68 65 6d 65 20 |d in the| Scheme |
|00003540| 77 6f 72 6c 64 29 2e 20 | 49 6e 73 74 65 61 64 2c |world). |Instead,|
|00003550| 20 74 68 69 73 20 6b 69 | 6e 64 20 6f 66 20 73 6c | this ki|nd of sl|
|00003560| 6f 74 20 68 61 73 20 69 | 74 73 20 76 61 6c 75 65 |ot has i|ts value|
|00003570| 20 77 68 69 63 68 0a 69 | 73 20 73 74 6f 72 65 64 | which.i|s stored|
|00003580| 20 69 6e 73 69 64 65 20 | 74 68 65 20 69 6e 74 65 | inside |the inte|
|00003590| 72 6e 61 6c 20 73 74 72 | 75 63 74 75 72 65 73 20 |rnal str|uctures |
|000035a0| 6f 66 20 74 68 65 20 54 | 6b 20 6c 69 62 72 61 72 |of the T|k librar|
|000035b0| 79 2e 20 54 68 6f 73 65 | 20 73 6c 6f 74 73 20 61 |y. Those| slots a|
|000035c0| 72 65 0a 61 6c 6c 6f 63 | 61 74 65 64 20 77 69 74 |re.alloc|ated wit|
|000035d0| 68 20 61 20 73 70 65 63 | 69 61 6c 20 61 6c 6c 6f |h a spec|ial allo|
|000035e0| 63 61 74 69 6f 6e 20 73 | 63 68 65 6d 65 20 77 68 |cation s|cheme wh|
|000035f0| 69 63 68 20 69 73 20 63 | 61 6c 6c 65 64 20 7b 5c |ich is c|alled {\|
|00003600| 74 74 0a 3a 74 6b 2d 76 | 69 72 74 75 61 6c 7d 2e |tt.:tk-v|irtual}.|
|00003610| 20 54 6b 20 76 69 72 74 | 75 61 6c 20 73 6c 6f 74 | Tk virt|ual slot|
|00003620| 73 20 61 72 65 20 6d 61 | 6e 61 67 65 64 20 62 79 |s are ma|naged by|
|00003630| 20 74 68 65 20 7b 5c 74 | 74 0a 3c 57 69 74 68 2d | the {\t|t.<With-|
|00003640| 54 6b 2d 76 69 72 74 75 | 61 6c 2d 73 6c 6f 74 73 |Tk-virtu|al-slots|
|00003650| 2d 6d 65 74 61 63 6c 61 | 73 73 3e 7d 20 6d 65 74 |-metacla|ss>} met|
|00003660| 61 2d 63 6c 61 73 73 2e | 0a 0a 43 6f 6e 73 65 71 |a-class.|..Conseq|
|00003670| 75 65 6e 74 6c 79 2c 20 | 72 65 61 64 69 6e 67 20 |uently, |reading |
|00003680| 6f 72 20 77 72 69 74 69 | 6e 67 20 61 20 7b 5c 65 |or writi|ng a {\e|
|00003690| 6d 20 74 6b 2d 76 69 72 | 74 75 61 6c 7d 20 73 6c |m tk-vir|tual} sl|
|000036a0| 6f 74 20 77 69 6c 6c 20 | 70 72 6f 76 6f 6b 65 20 |ot will |provoke |
|000036b0| 61 20 64 69 72 65 63 74 | 0a 72 65 61 64 69 6e 67 |a direct|.reading|
|000036c0| 20 6f 72 20 77 72 69 74 | 69 6e 67 20 6f 66 20 61 | or writ|ing of a|
|000036d0| 20 66 69 65 6c 64 20 6f | 66 20 74 68 65 20 54 6b | field o|f the Tk|
|000036e0| 2d 6c 69 62 72 61 72 79 | 20 43 2d 73 74 72 75 63 |-library| C-struc|
|000036f0| 74 75 72 65 20 61 73 73 | 6f 63 69 61 74 65 64 20 |ture ass|ociated |
|00003700| 74 6f 20 74 68 65 0a 6f | 62 6a 65 63 74 20 28 74 |to the.o|bject (t|
|00003710| 68 69 73 20 61 76 6f 69 | 64 20 74 6f 20 68 61 76 |his avoi|d to hav|
|00003720| 65 20 74 6f 20 73 79 6e | 63 68 72 6f 6e 69 7a 65 |e to syn|chronize|
|00003730| 20 76 61 6c 75 65 73 20 | 69 6e 20 74 68 65 20 54 | values |in the T|
|00003740| 6b 20 61 6e 64 20 53 63 | 68 65 6d 65 0a 77 6f 72 |k and Sc|heme.wor|
|00003750| 6c 64 29 2e 20 46 6f 72 | 20 65 61 63 68 20 7b 5c |ld). For| each {\|
|00003760| 65 6d 20 74 6b 2d 76 69 | 72 74 75 61 6c 7d 2c 20 |em tk-vi|rtual}, |
|00003770| 7b 5c 73 74 6b 6c 6f 73 | 7d 20 70 72 6f 76 69 64 |{\stklos|} provid|
|00003780| 65 73 20 61 6e 20 61 63 | 63 65 73 73 6f 72 3b 20 |es an ac|cessor; |
|00003790| 74 68 65 0a 66 6f 6c 6c | 6f 77 69 6e 67 20 65 78 |the.foll|owing ex|
|000037a0| 61 6d 70 6c 65 20 73 68 | 6f 77 73 20 73 6f 6d 65 |ample sh|ows some|
|000037b0| 20 73 69 6d 70 6c 65 20 | 75 73 61 67 65 73 20 6f | simple |usages o|
|000037c0| 66 20 74 68 69 73 20 6b | 69 6e 64 20 6f 66 20 73 |f this k|ind of s|
|000037d0| 6c 6f 74 73 2e 0a 0a 5c | 6e 6f 69 6e 64 65 6e 74 |lots...\|noindent|
|000037e0| 0a 7b 5c 65 6d 20 45 78 | 61 6d 70 6c 65 3a 7d 0a |.{\em Ex|ample:}.|
|000037f0| 5c 62 65 67 69 6e 7b 71 | 75 6f 74 65 7d 0a 5c 62 |\begin{q|uote}.\b|
|00003800| 65 67 69 6e 7b 76 65 72 | 62 61 74 69 6d 7d 0a 28 |egin{ver|batim}.(|
|00003810| 64 65 66 69 6e 65 20 6c | 61 62 20 28 6d 61 6b 65 |define l|ab (make|
|00003820| 20 3c 4c 61 62 65 6c 3e | 20 3a 74 65 78 74 20 22 | <Label>| :text "|
|00003830| 48 65 6c 6c 6f 22 20 3a | 72 65 6c 69 65 66 20 22 |Hello" :|relief "|
|00003840| 72 61 69 73 65 64 22 20 | 3a 62 61 63 6b 67 72 6f |raised" |:backgro|
|00003850| 75 6e 64 20 22 67 72 65 | 79 22 29 29 0a 28 72 65 |und "gre|y")).(re|
|00003860| 6c 69 65 66 20 6c 61 62 | 29 0a 20 20 20 20 20 20 |lief lab|). |
|00003870| 20 20 2d 2d 3e 20 22 72 | 61 69 73 65 64 22 0a 28 | --> "r|aised".(|
|00003880| 73 65 74 21 20 28 62 6f | 72 64 65 72 2d 77 69 64 |set! (bo|rder-wid|
|00003890| 74 68 20 6c 61 62 29 20 | 34 29 0a 28 62 6f 72 64 |th lab) |4).(bord|
|000038a0| 65 72 2d 77 69 64 74 68 | 20 6c 61 62 29 0a 20 20 |er-width| lab). |
|000038b0| 20 20 20 20 20 20 2d 2d | 3e 20 34 0a 5c 65 6e 64 | --|> 4.\end|
|000038c0| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 5c 65 6e 64 7b |{verbati|m}.\end{|
|000038d0| 71 75 6f 74 65 7d 0a 5c | 6e 6f 69 6e 64 65 6e 74 |quote}.\|noindent|
|000038e0| 0a 54 68 65 20 66 69 72 | 73 74 20 65 78 70 72 65 |.The fir|st expre|
|000038f0| 73 73 69 6f 6e 20 63 72 | 65 61 74 65 73 20 61 20 |ssion cr|eates a |
|00003900| 6e 65 77 20 69 6e 73 74 | 61 6e 63 65 20 6f 66 20 |new inst|ance of |
|00003910| 61 20 6c 61 62 65 6c 2c | 20 61 73 20 77 65 20 68 |a label,| as we h|
|00003920| 61 76 65 20 73 65 65 6e | 20 62 65 66 6f 72 65 2e |ave seen| before.|
|00003930| 20 54 68 65 0a 73 65 63 | 6f 6e 64 20 6f 6e 65 20 | The.sec|ond one |
|00003940| 71 75 65 72 69 65 73 20 | 74 68 65 20 54 6b 20 73 |queries |the Tk s|
|00003950| 65 72 76 65 72 20 61 62 | 6f 75 74 20 74 68 65 20 |erver ab|out the |
|00003960| 72 65 6c 69 65 66 20 6f | 66 20 74 68 65 20 6c 61 |relief o|f the la|
|00003970| 62 65 6c 20 7b 5c 74 74 | 20 6c 61 62 7d 2e 0a 46 |bel {\tt| lab}..F|
|00003980| 69 6e 61 6c 6c 79 2c 20 | 74 68 65 20 7b 5c 74 74 |inally, |the {\tt|
|00003990| 20 73 65 74 21 7d 20 65 | 78 70 72 65 73 73 69 6f | set!} e|xpressio|
|000039a0| 6e 20 70 65 72 6d 69 74 | 73 20 74 6f 20 63 68 61 |n permit|s to cha|
|000039b0| 6e 67 65 20 74 68 65 20 | 76 61 6c 75 65 20 6f 66 |nge the |value of|
|000039c0| 20 74 68 65 0a 77 69 64 | 74 68 20 6f 66 20 7b 5c | the.wid|th of {\|
|000039d0| 74 74 20 6c 61 62 7d 27 | 73 20 62 6f 72 64 65 72 |tt lab}'|s border|
|000039e0| 2e 0a 0a 5c 73 75 62 73 | 65 63 74 69 6f 6e 7b 54 |...\subs|ection{T|
|000039f0| 68 65 20 7b 5c 74 74 20 | 3c 54 6b 2d 63 61 6e 76 |he {\tt |<Tk-canv|
|00003a00| 61 73 2d 69 74 65 6d 3e | 7d 20 63 6c 61 73 73 7d |as-item>|} class}|
|00003a10| 0a 0a 49 6e 73 74 61 6e | 63 65 73 20 6f 66 20 7b |..Instan|ces of {|
|00003a20| 5c 74 74 20 3c 54 6b 2d | 63 61 6e 76 61 73 2d 69 |\tt <Tk-|canvas-i|
|00003a30| 74 65 6d 3e 7d 20 63 6c | 61 73 73 2c 20 61 73 20 |tem>} cl|ass, as |
|00003a40| 73 61 69 64 20 62 65 66 | 6f 72 65 2c 20 61 72 65 |said bef|ore, are|
|00003a50| 20 6f 62 6a 65 63 74 73 | 20 73 75 63 68 20 61 73 | objects| such as|
|00003a60| 0a 72 65 63 74 61 6e 67 | 6c 65 73 2c 20 63 69 72 |.rectang|les, cir|
|00003a70| 63 6c 65 73 20 6f 72 20 | 62 69 74 6d 61 70 73 20 |cles or |bitmaps |
|00003a80| 77 68 69 63 68 20 61 72 | 65 20 63 6f 6e 74 61 69 |which ar|e contai|
|00003a90| 6e 65 64 20 69 6e 20 61 | 20 77 69 6e 64 6f 77 2e |ned in a| window.|
|00003aa0| 20 41 20 77 69 6e 64 6f | 77 0a 63 6f 6e 74 61 69 | A windo|w.contai|
|00003ab0| 6e 69 6e 67 20 74 68 69 | 73 20 6b 69 6e 64 20 6f |ning thi|s kind o|
|00003ac0| 66 20 6f 62 6a 65 63 74 | 20 69 73 20 61 20 73 70 |f object| is a sp|
|00003ad0| 65 63 69 61 6c 20 73 69 | 6d 70 6c 65 20 77 69 64 |ecial si|mple wid|
|00003ae0| 67 65 74 20 63 61 6c 6c | 65 64 20 61 20 7b 5c 65 |get call|ed a {\e|
|00003af0| 6d 0a 63 61 6e 76 61 73 | 7d 2e 20 41 6c 6c 20 74 |m.canvas|}. All t|
|00003b00| 68 65 20 6f 62 6a 65 63 | 74 73 20 64 65 66 69 6e |he objec|ts defin|
|00003b10| 65 64 20 69 6e 20 61 20 | 7b 5c 65 6d 20 63 61 6e |ed in a |{\em can|
|00003b20| 76 61 73 7d 20 63 61 6e | 20 62 65 20 6d 61 6e 69 |vas} can| be mani|
|00003b30| 70 75 6c 61 74 65 64 0a | 28 65 2e 67 2e 20 6d 6f |pulated.|(e.g. mo|
|00003b40| 76 65 64 2c 20 72 65 2d | 63 6f 6c 6f 72 65 64 20 |ved, re-|colored |
|00003b50| 6f 72 20 72 65 2d 73 69 | 7a 65 64 29 20 61 6e 64 |or re-si|zed) and|
|00003b60| 20 65 76 65 6e 20 53 63 | 68 65 6d 65 20 63 6f 6d | even Sc|heme com|
|00003b70| 6d 61 6e 64 20 63 61 6e | 20 62 65 20 61 73 73 6f |mand can| be asso|
|00003b80| 63 69 61 74 65 64 0a 74 | 6f 20 74 68 65 6d 2e 20 |ciated.t|o them. |
|00003b90| 20 41 6c 6c 20 74 68 65 | 20 61 63 74 69 6f 6e 73 | All the| actions|
|00003ba0| 20 61 76 61 69 6c 61 62 | 6c 65 20 66 6f 72 20 7b | availab|le for {|
|00003bb0| 5c 74 74 20 3c 54 6b 2d | 63 61 6e 76 61 73 2d 69 |\tt <Tk-|canvas-i|
|00003bc0| 74 65 6d 3e 7d 73 20 0a | 61 72 65 20 64 65 66 65 |tem>}s .|are defe|
|00003bd0| 72 72 65 64 20 74 6f 20 | 61 20 6e 65 78 74 20 63 |rred to |a next c|
|00003be0| 68 61 70 74 65 72 20 28 | 5c 72 65 66 7b 43 61 6e |hapter (|\ref{Can|
|00003bf0| 76 61 73 2d 63 68 61 70 | 74 65 72 7d 29 2e 0a 0a |vas-chap|ter})...|
|00003c00| 5c 73 65 63 74 69 6f 6e | 7b 46 75 6e 63 74 69 6f |\section|{Functio|
|00003c10| 6e 73 20 6f 66 20 74 68 | 69 73 20 63 68 61 70 74 |ns of th|is chapt|
|00003c20| 65 72 7d 0a 54 68 69 73 | 20 73 65 63 74 69 6f 6e |er}.This| section|
|00003c30| 20 70 72 65 73 65 6e 74 | 73 20 69 6e 20 64 65 74 | present|s in det|
|00003c40| 61 69 6c 73 20 74 68 65 | 20 6d 65 74 68 6f 64 73 |ails the| methods|
|00003c50| 20 61 6e 64 20 66 75 6e | 63 74 69 6f 6e 73 20 73 | and fun|ctions s|
|00003c60| 65 65 6e 20 69 6e 20 74 | 68 69 73 0a 63 68 61 70 |een in t|his.chap|
|00003c70| 74 65 72 20 28 6f 72 20 | 6d 65 74 68 6f 64 73 20 |ter (or |methods |
|00003c80| 61 6e 64 20 66 75 6e 63 | 74 69 6f 6e 73 20 72 65 |and func|tions re|
|00003c90| 6c 61 74 65 64 20 74 6f | 20 74 68 69 6e 67 73 20 |lated to| things |
|00003ca0| 73 65 65 6e 20 69 6e 20 | 74 68 69 73 20 63 68 61 |seen in |this cha|
|00003cb0| 70 74 65 72 29 2e 0a 46 | 75 6e 63 74 69 6f 6e 73 |pter)..F|unctions|
|00003cc0| 20 61 72 65 20 6c 69 73 | 74 65 64 20 62 65 6c 6f | are lis|ted belo|
|00003cd0| 77 20 69 6e 20 61 6c 70 | 68 61 62 65 74 69 63 61 |w in alp|habetica|
|00003ce0| 6c 20 6f 72 64 65 72 2e | 0a 0a 25 25 25 25 25 25 |l order.|..%%%%%%|
|00003cf0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003d00| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003d10| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003d20| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003d30| 25 25 25 25 25 25 25 25 | 0a 25 0a 25 20 44 45 53 |%%%%%%%%|.%.% DES|
|00003d40| 54 52 4f 59 0a 25 0a 25 | 25 25 25 25 25 25 25 25 |TROY.%.%|%%%%%%%%|
|00003d50| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003d60| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003d70| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003d80| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003d90| 25 25 25 25 25 0a 0a 5c | 6c 61 62 65 6c 7b 70 61 |%%%%%..\|label{pa|
|00003da0| 63 6b 65 72 2d 64 6f 63 | 7d 0a 5c 73 63 68 65 6d |cker-doc|}.\schem|
|00003db0| 65 74 69 74 6c 65 7b 64 | 65 73 74 72 6f 79 7d 7b |etitle{d|estroy}{|
|00003dc0| 6d 65 74 68 6f 64 7d 0a | 0a 5c 62 65 67 69 6e 7b |method}.|.\begin{|
|00003dd0| 73 63 68 65 6d 65 64 6f | 63 7d 7b 53 79 6e 74 61 |schemedo|c}{Synta|
|00003de0| 78 7d 0a 5c 62 65 67 69 | 6e 7b 76 65 72 62 61 74 |x}.\begi|n{verbat|
|00003df0| 69 6d 7d 0a 64 65 73 74 | 72 6f 79 20 20 20 20 20 |im}.dest|roy |
|00003e00| 20 20 20 20 28 28 73 65 | 6c 66 20 3c 54 6b 2d 77 | ((se|lf <Tk-w|
|00003e10| 69 64 67 65 74 3e 29 29 | 0a 64 65 73 74 72 6f 79 |idget>))|.destroy|
|00003e20| 20 20 20 20 20 20 20 20 | 20 6c 0a 5c 65 6e 64 7b | | l.\end{|
|00003e30| 76 65 72 62 61 74 69 6d | 7d 0a 5c 65 6e 64 7b 73 |verbatim|}.\end{s|
|00003e40| 63 68 65 6d 65 64 6f 63 | 7d 0a 0a 5c 62 65 67 69 |chemedoc|}..\begi|
|00003e50| 6e 7b 73 63 68 65 6d 65 | 64 6f 63 7d 7b 41 72 67 |n{scheme|doc}{Arg|
|00003e60| 75 6d 65 6e 74 73 20 28 | 66 69 72 73 74 20 66 6f |uments (|first fo|
|00003e70| 72 6d 29 7d 0a 5c 62 65 | 67 69 6e 7b 64 65 73 63 |rm)}.\be|gin{desc|
|00003e80| 72 69 70 74 69 6f 6e 7d | 0a 5c 69 74 65 6d 5b 73 |ription}|.\item[s|
|00003e90| 65 6c 66 5d 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |elf] the| window |
|00003ea0| 74 6f 20 64 65 73 74 72 | 6f 79 2e 0a 5c 65 6e 64 |to destr|oy..\end|
|00003eb0| 7b 64 65 73 63 72 69 70 | 74 69 6f 6e 7d 0a 5c 65 |{descrip|tion}.\e|
|00003ec0| 6e 64 7b 73 63 68 65 6d | 65 64 6f 63 7d 0a 0a 5c |nd{schem|edoc}..\|
|00003ed0| 62 65 67 69 6e 7b 73 63 | 68 65 6d 65 64 6f 63 7d |begin{sc|hemedoc}|
|00003ee0| 7b 41 72 67 75 6d 65 6e | 74 73 20 28 73 65 63 6f |{Argumen|ts (seco|
|00003ef0| 6e 64 20 66 6f 72 6d 29 | 7d 0a 5c 62 65 67 69 6e |nd form)|}.\begin|
|00003f00| 7b 64 65 73 63 72 69 70 | 74 69 6f 6e 7d 0a 5c 69 |{descrip|tion}.\i|
|00003f10| 74 65 6d 5b 6c 5d 20 61 | 20 6c 69 73 74 20 6f 66 |tem[l] a| list of|
|00003f20| 20 77 69 6e 64 6f 77 20 | 74 6f 20 64 65 73 74 72 | window |to destr|
|00003f30| 6f 79 20 28 74 68 69 73 | 20 66 6f 72 6d 20 6d 61 |oy (this| form ma|
|00003f40| 70 73 20 69 6e 20 66 61 | 63 74 73 20 74 68 65 20 |ps in fa|cts the |
|00003f50| 70 72 65 76 69 6f 75 73 | 20 6f 6e 65 20 74 6f 0a |previous| one to.|
|00003f60| 61 6c 6c 20 69 74 73 20 | 61 72 67 75 6d 65 6e 74 |all its |argument|
|00003f70| 73 20 74 6f 20 61 6c 6c | 6f 77 20 6d 75 6c 74 69 |s to all|ow multi|
|00003f80| 70 6c 65 20 64 65 73 74 | 72 75 63 74 69 6f 6e 29 |ple dest|ruction)|
|00003f90| 2e 0a 5c 65 6e 64 7b 64 | 65 73 63 72 69 70 74 69 |..\end{d|escripti|
|00003fa0| 6f 6e 7d 0a 5c 65 6e 64 | 7b 73 63 68 65 6d 65 64 |on}.\end|{schemed|
|00003fb0| 6f 63 7d 0a 0a 5c 62 65 | 67 69 6e 7b 73 63 68 65 |oc}..\be|gin{sche|
|00003fc0| 6d 65 64 6f 63 7d 7b 44 | 65 73 63 72 69 70 74 69 |medoc}{D|escripti|
|00003fd0| 6f 6e 7d 0a 7b 5c 74 74 | 20 44 65 73 74 72 6f 79 |on}.{\tt| Destroy|
|00003fe0| 7d 20 64 65 6c 65 74 65 | 73 20 74 68 65 20 7b 5c |} delete|s the {\|
|00003ff0| 74 74 20 73 65 6c 66 7d | 20 77 69 64 67 65 74 20 |tt self}| widget |
|00004000| 77 69 6e 64 6f 77 20 61 | 6e 64 20 61 6c 6c 20 6f |window a|nd all o|
|00004010| 66 20 69 74 73 20 64 65 | 73 63 65 6e 64 61 6e 74 |f its de|scendant|
|00004020| 73 2e 0a 49 66 20 7b 5c | 74 74 20 73 65 6c 66 7d |s..If {\|tt self}|
|00004030| 20 65 71 75 61 6c 73 20 | 74 6f 20 7b 5c 74 74 20 | equals |to {\tt |
|00004040| 2a 74 6f 70 2d 72 6f 6f | 74 2a 7d 2c 20 74 68 65 |*top-roo|t*}, the|
|00004050| 20 69 6e 74 65 72 70 72 | 65 74 65 72 20 74 65 72 | interpr|eter ter|
|00004060| 6d 69 6e 61 74 65 73 20 | 69 74 73 20 65 78 65 63 |minates |its exec|
|00004070| 75 74 69 6f 6e 2e 0a 5c | 65 6e 64 7b 73 63 68 65 |ution..\|end{sche|
|00004080| 6d 65 64 6f 63 7d 0a 0a | 5c 62 65 67 69 6e 7b 73 |medoc}..|\begin{s|
|00004090| 63 68 65 6d 65 64 6f 63 | 7d 7b 52 65 73 75 6c 74 |chemedoc|}{Result|
|000040a0| 7d 0a 54 68 65 20 64 65 | 73 74 72 6f 79 65 64 20 |}.The de|stroyed |
|000040b0| 6f 62 6a 65 63 74 20 28 | 73 65 65 20 6e 6f 74 65 |object (|see note|
|000040c0| 20 62 65 6c 6f 77 29 0a | 5c 65 6e 64 7b 73 63 68 | below).|\end{sch|
|000040d0| 65 6d 65 64 6f 63 7d 0a | 0a 5c 62 65 67 69 6e 7b |emedoc}.|.\begin{|
|000040e0| 73 63 68 65 6d 65 64 6f | 63 7d 7b 45 78 61 6d 70 |schemedo|c}{Examp|
|000040f0| 6c 65 7d 0a 5c 62 65 67 | 69 6e 7b 76 65 72 62 61 |le}.\beg|in{verba|
|00004100| 74 69 6d 7d 0a 28 64 65 | 66 69 6e 65 20 6c 31 20 |tim}.(de|fine l1 |
|00004110| 28 6d 61 6b 65 20 3c 4c | 61 62 65 6c 3e 20 3a 74 |(make <L|abel> :t|
|00004120| 65 78 74 20 22 6c 61 62 | 31 22 29 29 0a 2e 2e 2e |ext "lab|1"))....|
|00004130| 0a 28 64 65 66 69 6e 65 | 20 6c 35 20 28 6d 61 6b |.(define| l5 (mak|
|00004140| 65 20 3c 4c 61 62 65 6c | 3e 20 3a 74 65 78 74 20 |e <Label|> :text |
|00004150| 22 6c 61 62 35 22 29 29 | 0a 28 64 65 73 74 72 6f |"lab5"))|.(destro|
|00004160| 79 20 6c 31 29 20 20 20 | 20 20 20 20 20 20 20 20 |y l1) | |
|00004170| 20 20 3b 3b 20 64 69 72 | 65 63 74 20 63 61 6c 6c | ;; dir|ect call|
|00004180| 20 6f 66 20 66 69 72 73 | 74 20 66 6f 72 6d 0a 28 | of firs|t form.(|
|00004190| 64 65 73 74 72 6f 79 20 | 6c 32 20 6c 33 20 6c 34 |destroy |l2 l3 l4|
|000041a0| 20 6c 35 29 20 20 20 20 | 3b 3b 20 63 61 6c 6c 20 | l5) |;; call |
|000041b0| 6f 66 20 74 68 65 20 73 | 65 63 6f 6e 64 20 66 6f |of the s|econd fo|
|000041c0| 72 6d 0a 5c 65 6e 64 7b | 76 65 72 62 61 74 69 6d |rm.\end{|verbatim|
|000041d0| 7d 0a 5c 65 6e 64 7b 73 | 63 68 65 6d 65 64 6f 63 |}.\end{s|chemedoc|
|000041e0| 7d 0a 0a 0a 5c 62 65 67 | 69 6e 7b 73 63 68 65 6d |}...\beg|in{schem|
|000041f0| 65 64 6f 63 7d 7b 4e 6f | 74 65 7d 0a 57 68 65 6e |edoc}{No|te}.When|
|00004200| 20 61 20 77 69 64 67 65 | 74 20 69 73 20 64 65 73 | a widge|t is des|
|00004210| 74 72 6f 79 65 64 2c 20 | 69 74 73 20 63 6c 61 73 |troyed, |its clas|
|00004220| 73 20 69 73 20 63 68 61 | 6e 67 65 64 20 74 6f 20 |s is cha|nged to |
|00004230| 3c 44 65 73 74 72 6f 79 | 65 64 2d 6f 62 6a 65 63 |<Destroy|ed-objec|
|00004240| 74 3e 20 61 73 0a 73 68 | 6f 77 6e 20 62 65 6c 6f |t> as.sh|own belo|
|00004250| 77 3a 0a 5c 62 65 67 69 | 6e 7b 71 75 6f 74 65 7d |w:.\begi|n{quote}|
|00004260| 0a 5c 62 65 67 69 6e 7b | 76 65 72 62 61 74 69 6d |.\begin{|verbatim|
|00004270| 7d 0a 28 64 65 66 69 6e | 65 20 6c 61 62 20 28 6d |}.(defin|e lab (m|
|00004280| 61 6b 65 20 3c 4c 61 62 | 65 6c 3e 20 3a 74 65 78 |ake <Lab|el> :tex|
|00004290| 74 20 22 41 20 6c 61 62 | 65 6c 22 29 29 0a 28 63 |t "A lab|el")).(c|
|000042a0| 6c 61 73 73 2d 6e 61 6d | 65 20 28 63 6c 61 73 73 |lass-nam|e (class|
|000042b0| 2d 6f 66 20 6c 61 62 29 | 29 0a 20 20 20 20 20 20 |-of lab)|). |
|000042c0| 20 20 2d 2d 3e 20 3c 6c | 61 62 65 6c 3e 0a 28 64 | --> <l|abel>.(d|
|000042d0| 65 73 74 72 6f 79 20 6c | 61 62 29 0a 28 63 6c 61 |estroy l|ab).(cla|
|000042e0| 73 73 2d 6e 61 6d 65 20 | 28 63 6c 61 73 73 2d 6f |ss-name |(class-o|
|000042f0| 66 20 6c 61 62 29 29 0a | 20 20 20 20 20 20 20 20 |f lab)).| |
|00004300| 2d 2d 3e 20 3c 64 65 73 | 74 72 6f 79 65 64 2d 6f |--> <des|troyed-o|
|00004310| 62 6a 65 63 74 3e 0a 5c | 65 6e 64 7b 76 65 72 62 |bject>.\|end{verb|
|00004320| 61 74 69 6d 7d 0a 5c 65 | 6e 64 7b 71 75 6f 74 65 |atim}.\e|nd{quote|
|00004330| 7d 0a 0a 5c 65 6e 64 7b | 73 63 68 65 6d 65 64 6f |}..\end{|schemedo|
|00004340| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 73 63 68 65 6d |c}..\beg|in{schem|
|00004350| 65 64 6f 63 7d 7b 53 65 | 65 20 61 6c 73 6f 7d 0a |edoc}{Se|e also}.|
|00004360| 7b 5c 74 74 20 64 65 73 | 74 72 6f 79 7d 20 6d 65 |{\tt des|troy} me|
|00004370| 74 68 6f 64 20 66 6f 72 | 20 63 61 6e 76 61 73 65 |thod for| canvase|
|00004380| 73 2c 20 75 6e 70 61 63 | 6b 0a 5c 65 6e 64 7b 73 |s, unpac|k.\end{s|
|00004390| 63 68 65 6d 65 64 6f 63 | 7d 0a 0a 25 25 25 25 25 |chemedoc|}..%%%%%|
|000043a0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000043b0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000043c0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000043d0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000043e0| 25 25 25 25 25 25 25 25 | 25 0a 25 0a 25 20 50 41 |%%%%%%%%|%.%.% PA|
|000043f0| 43 4b 0a 25 0a 25 25 25 | 25 25 25 25 25 25 25 25 |CK.%.%%%|%%%%%%%%|
|00004400| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004410| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004420| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004430| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004440| 25 25 25 0a 0a 5c 73 63 | 68 65 6d 65 74 69 74 6c |%%%..\sc|hemetitl|
|00004450| 65 7b 70 61 63 6b 7d 7b | 70 72 6f 63 65 64 75 72 |e{pack}{|procedur|
|00004460| 65 7d 0a 5c 6c 61 62 65 | 6c 7b 70 61 63 6b 2d 64 |e}.\labe|l{pack-d|
|00004470| 6f 63 7d 0a 5c 62 65 67 | 69 6e 7b 73 63 68 65 6d |oc}.\beg|in{schem|
|00004480| 65 64 6f 63 7d 7b 53 79 | 6e 74 61 78 7d 0a 5c 62 |edoc}{Sy|ntax}.\b|
|00004490| 65 67 69 6e 7b 76 65 72 | 62 61 74 69 6d 7d 0a 70 |egin{ver|batim}.p|
|000044a0| 61 63 6b 20 6c 20 0a 5c | 65 6e 64 7b 76 65 72 62 |ack l .\|end{verb|
|000044b0| 61 74 69 6d 7d 0a 5c 65 | 6e 64 7b 73 63 68 65 6d |atim}.\e|nd{schem|
|000044c0| 65 64 6f 63 7d 0a 0a 5c | 62 65 67 69 6e 7b 73 63 |edoc}..\|begin{sc|
|000044d0| 68 65 6d 65 64 6f 63 7d | 7b 41 72 67 75 6d 65 6e |hemedoc}|{Argumen|
|000044e0| 74 73 7d 0a 7b 5c 74 74 | 20 70 61 63 6b 7d 20 61 |ts}.{\tt| pack} a|
|000044f0| 63 63 65 70 74 73 20 61 | 20 6c 69 73 74 20 6f 66 |ccepts a| list of|
|00004500| 20 61 72 67 75 6d 65 6e | 74 73 20 77 68 6f 73 65 | argumen|ts whose|
|00004510| 20 62 65 68 61 76 69 6f | 72 20 64 65 70 65 6e 64 | behavio|r depend|
|00004520| 73 20 6f 6e 20 74 68 65 | 20 66 69 72 73 74 0a 65 |s on the| first.e|
|00004530| 6c 65 6d 65 6e 74 20 6f | 66 20 74 68 69 73 20 6c |lement o|f this l|
|00004540| 69 73 74 2e 0a 0a 5c 70 | 61 72 61 67 72 61 70 68 |ist...\p|aragraph|
|00004550| 7b 5c 74 74 20 28 70 61 | 63 6b 20 27 73 6c 61 76 |{\tt (pa|ck 'slav|
|00004560| 65 20 5b 73 6c 61 76 65 | 20 2e 2e 2e 5d 20 5b 6f |e [slave| ...] [o|
|00004570| 70 74 69 6f 6e 5d 29 7d | 0a 5c 62 65 67 69 6e 7b |ption])}|.\begin{|
|00004580| 71 75 6f 74 65 7d 0a 49 | 66 20 74 68 65 20 66 69 |quote}.I|f the fi|
|00004590| 72 73 74 20 61 72 67 75 | 6d 65 6e 74 20 74 6f 20 |rst argu|ment to |
|000045a0| 7b 5c 74 74 20 70 61 63 | 6b 7d 20 69 73 20 61 20 |{\tt pac|k} is a |
|000045b0| 77 69 64 67 65 74 2c 20 | 74 68 65 6e 20 74 68 65 |widget, |then the|
|000045c0| 20 63 6f 6d 6d 61 6e 64 | 20 69 73 0a 70 72 6f 63 | command| is.proc|
|000045d0| 65 73 73 65 64 20 69 6e | 20 74 68 65 20 73 61 6d |essed in| the sam|
|000045e0| 65 20 77 61 79 20 61 73 | 20 7b 5c 74 74 20 28 70 |e way as| {\tt (p|
|000045f0| 61 63 6b 20 27 63 6f 6e | 66 69 67 75 72 65 20 2e |ack 'con|figure .|
|00004600| 2e 2e 29 7d 2e 0a 5c 65 | 6e 64 7b 71 75 6f 74 65 |..)}..\e|nd{quote|
|00004610| 7d 0a 0a 5c 70 61 72 61 | 67 72 61 70 68 7b 5c 74 |}..\para|graph{\t|
|00004620| 74 20 28 70 61 63 6b 20 | 27 63 6f 6e 66 69 67 75 |t (pack |'configu|
|00004630| 72 65 20 5b 73 6c 61 76 | 65 20 2e 2e 2e 5d 20 5b |re [slav|e ...] [|
|00004640| 6f 70 74 69 6f 6e 5d 29 | 7d 0a 0a 5c 62 65 67 69 |option])|}..\begi|
|00004650| 6e 7b 71 75 6f 74 65 7d | 0a 54 68 65 20 61 72 67 |n{quote}|.The arg|
|00004660| 75 6d 65 6e 74 73 20 63 | 6f 6e 73 69 73 74 20 6f |uments c|onsist o|
|00004670| 66 20 6f 6e 65 20 6f 72 | 20 6d 6f 72 65 20 73 6c |f one or| more sl|
|00004680| 61 76 65 20 77 69 6e 64 | 6f 77 73 20 66 6f 6c 6c |ave wind|ows foll|
|00004690| 6f 77 65 64 20 62 79 20 | 70 61 69 72 73 20 6f 66 |owed by |pairs of|
|000046a0| 0a 61 72 67 75 6d 65 6e | 74 73 20 74 68 61 74 20 |.argumen|ts that |
|000046b0| 73 70 65 63 69 66 79 20 | 68 6f 77 20 74 6f 20 6d |specify |how to m|
|000046c0| 61 6e 61 67 65 20 74 68 | 65 20 73 6c 61 76 65 73 |anage th|e slaves|
|000046d0| 2e 20 20 53 65 65 20 60 | 60 54 48 45 20 50 41 43 |. See `|`THE PAC|
|000046e0| 4b 45 52 0a 41 4c 47 4f | 52 49 54 48 4d 27 27 20 |KER.ALGO|RITHM'' |
|000046f0| 62 65 6c 6f 77 20 66 6f | 72 20 64 65 74 61 69 6c |below fo|r detail|
|00004700| 73 20 6f 6e 20 68 6f 77 | 20 74 68 65 20 6f 70 74 |s on how| the opt|
|00004710| 69 6f 6e 73 20 61 72 65 | 20 75 73 65 64 20 62 79 |ions are| used by|
|00004720| 20 74 68 65 20 70 61 63 | 6b 65 72 2e 0a 54 68 65 | the pac|ker..The|
|00004730| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 6f 70 74 69 6f | followi|ng optio|
|00004740| 6e 73 20 61 72 65 20 73 | 75 70 70 6f 72 74 65 64 |ns are s|upported|
|00004750| 3a 0a 5c 62 65 67 69 6e | 7b 71 75 6f 74 65 7d 0a |:.\begin|{quote}.|
|00004760| 5c 70 61 72 0a 7b 5c 74 | 74 20 3a 61 66 74 65 72 |\par.{\t|t :after|
|00004770| 20 20 6f 74 68 65 72 7d | 5c 5c 0a 7b 5c 74 74 20 | other}|\\.{\tt |
|00004780| 3a 62 65 66 6f 72 65 20 | 6f 74 68 65 72 7d 0a 20 |:before |other}. |
|00004790| 20 20 20 20 20 20 20 5c | 62 65 67 69 6e 7b 71 75 | \|begin{qu|
|000047a0| 6f 74 65 7d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ote}. | |
|000047b0| 20 20 20 20 20 20 20 20 | 20 20 7b 5c 74 74 20 4f | | {\tt O|
|000047c0| 74 68 65 72 7d 20 6d 75 | 73 74 20 74 68 65 20 6e |ther} mu|st the n|
|000047d0| 61 6d 65 20 6f 66 20 61 | 6e 6f 74 68 65 72 20 77 |ame of a|nother w|
|000047e0| 69 6e 64 6f 77 2e 20 20 | 20 55 73 65 0a 20 20 20 |indow. | Use. |
|000047f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004800| 20 20 69 74 73 20 6d 61 | 73 74 65 72 20 61 73 20 | its ma|ster as |
|00004810| 74 68 65 20 6d 61 73 74 | 65 72 20 66 6f 72 20 74 |the mast|er for t|
|00004820| 68 65 20 73 6c 61 76 65 | 73 2c 20 61 6e 64 0a 20 |he slave|s, and. |
|00004830| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004840| 20 20 20 20 69 6e 73 65 | 72 74 20 74 68 65 20 73 | inse|rt the s|
|00004850| 6c 61 76 65 73 20 6a 75 | 73 74 20 61 66 74 65 72 |laves ju|st after|
|00004860| 20 28 6f 72 20 62 65 66 | 6f 72 65 29 20 20 7b 5c | (or bef|ore) {\|
|00004870| 74 74 20 6f 74 68 65 72 | 7d 20 0a 20 20 20 20 20 |tt other|} . |
|00004880| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004890| 69 6e 20 20 74 68 65 20 | 70 61 63 6b 69 6e 67 20 |in the |packing |
|000048a0| 6f 72 64 65 72 2e 0a 20 | 20 20 20 20 20 20 20 5c |order.. | \|
|000048b0| 65 6e 64 7b 71 75 6f 74 | 65 7d 0a 0a 5c 70 61 72 |end{quot|e}..\par|
|000048c0| 0a 7b 5c 74 74 20 3a 61 | 6e 63 68 6f 72 20 61 6e |.{\tt :a|nchor an|
|000048d0| 63 68 6f 72 7d 0a 20 20 | 20 20 20 20 20 20 5c 62 |chor}. | \b|
|000048e0| 65 67 69 6e 7b 71 75 6f | 74 65 7d 0a 20 20 20 20 |egin{quo|te}. |
|000048f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004900| 20 7b 5c 74 74 20 41 6e | 63 68 6f 72 7d 20 6d 75 | {\tt An|chor} mu|
|00004910| 73 74 20 62 65 20 61 20 | 76 61 6c 69 64 20 61 6e |st be a |valid an|
|00004920| 63 68 6f 72 20 70 6f 73 | 69 74 69 6f 6e 20 73 75 |chor pos|ition su|
|00004930| 63 68 20 61 73 0a 20 20 | 20 20 20 20 20 20 20 20 |ch as. | |
|00004940| 20 20 20 20 20 20 20 20 | 20 20 20 60 60 7b 5c 74 | | ``{\t|
|00004950| 74 20 6e 7d 27 27 20 6f | 72 20 60 60 7b 5c 74 74 |t n}'' o|r ``{\tt|
|00004960| 20 73 77 7d 27 27 3b 20 | 69 74 20 73 70 65 63 69 | sw}''; |it speci|
|00004970| 66 69 65 73 20 77 68 65 | 72 65 20 74 6f 0a 20 20 |fies whe|re to. |
|00004980| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004990| 20 20 20 70 6f 73 69 74 | 69 6f 6e 20 65 61 63 68 | posit|ion each|
|000049a0| 20 73 6c 61 76 65 20 69 | 6e 20 69 74 73 20 70 61 | slave i|n its pa|
|000049b0| 72 63 65 6c 2e 20 20 44 | 65 66 61 75 6c 74 73 20 |rcel. D|efaults |
|000049c0| 74 6f 20 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |to . | |
|000049d0| 20 20 20 20 20 20 20 20 | 20 60 60 7b 5c 74 74 20 | | ``{\tt |
|000049e0| 63 65 6e 74 65 72 7d 27 | 27 2e 0a 20 20 20 20 20 |center}'|'.. |
|000049f0| 20 20 20 5c 65 6e 64 7b | 71 75 6f 74 65 7d 0a 5c | \end{|quote}.\|
|00004a00| 70 61 72 0a 7b 5c 74 74 | 20 3a 65 78 70 61 6e 64 |par.{\tt| :expand|
|00004a10| 20 62 6f 6f 6c 65 61 6e | 7d 0a 20 20 20 20 20 20 | boolean|}. |
|00004a20| 20 20 5c 62 65 67 69 6e | 7b 71 75 6f 74 65 7d 0a | \begin|{quote}.|
|00004a30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004a40| 20 20 20 20 20 53 70 65 | 63 69 66 69 65 73 20 20 | Spe|cifies |
|00004a50| 20 77 68 65 74 68 65 72 | 20 20 74 68 65 20 20 73 | whether| the s|
|00004a60| 6c 61 76 65 73 20 20 73 | 68 6f 75 6c 64 20 20 62 |laves s|hould b|
|00004a70| 65 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |e. | |
|00004a80| 20 20 20 20 20 20 20 65 | 78 70 61 6e 64 65 64 20 | e|xpanded |
|00004a90| 74 6f 20 63 6f 6e 73 75 | 6d 65 20 20 65 78 74 72 |to consu|me extr|
|00004aa0| 61 20 20 73 70 61 63 65 | 20 20 69 6e 20 20 74 68 |a space| in th|
|00004ab0| 65 69 72 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |eir. | |
|00004ac0| 20 20 20 20 20 20 20 20 | 20 6d 61 73 74 65 72 2e | | master.|
|00004ad0| 20 20 44 65 66 61 75 6c | 74 73 20 74 6f 20 7b 5c | Defaul|ts to {\|
|00004ae0| 74 74 20 5c 23 66 7d 2e | 0a 20 20 20 20 20 20 20 |tt \#f}.|. |
|00004af0| 20 5c 65 6e 64 7b 71 75 | 6f 74 65 7d 0a 5c 70 61 | \end{qu|ote}.\pa|
|00004b00| 72 0a 7b 5c 74 74 20 3a | 66 69 6c 6c 20 73 74 79 |r.{\tt :|fill sty|
|00004b10| 6c 65 7d 0a 20 20 20 20 | 20 20 20 20 5c 62 65 67 |le}. | \beg|
|00004b20| 69 6e 7b 71 75 6f 74 65 | 7d 0a 20 20 20 20 20 20 |in{quote|}. |
|00004b30| 20 20 20 49 66 20 61 20 | 20 73 6c 61 76 65 27 73 | If a | slave's|
|00004b40| 20 20 70 61 72 63 65 6c | 20 20 69 73 20 20 6c 61 | parcel| is la|
|00004b50| 72 67 65 72 20 20 74 68 | 61 6e 20 20 69 74 73 0a |rger th|an its.|
|00004b60| 20 20 20 20 20 20 20 20 | 20 72 65 71 75 65 73 74 | | request|
|00004b70| 65 64 20 20 64 69 6d 65 | 6e 73 69 6f 6e 73 2c 20 |ed dime|nsions, |
|00004b80| 20 74 68 69 73 20 20 6f | 70 74 69 6f 6e 20 20 6d | this o|ption m|
|00004b90| 61 79 20 62 65 0a 20 20 | 20 20 20 20 20 20 20 75 |ay be. | u|
|00004ba0| 73 65 64 20 74 6f 20 73 | 74 72 65 74 63 68 20 74 |sed to s|tretch t|
|00004bb0| 68 65 20 73 6c 61 76 65 | 2e 20 20 7b 5c 74 74 20 |he slave|. {\tt |
|00004bc0| 53 74 79 6c 65 7d 20 6d | 75 73 74 20 20 68 61 76 |Style} m|ust hav|
|00004bd0| 65 0a 20 20 20 20 20 20 | 20 20 20 6f 6e 65 20 6f |e. | one o|
|00004be0| 66 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |f the fo|llowing |
|00004bf0| 76 61 6c 75 65 73 3a 0a | 0a 20 20 20 20 20 20 20 |values:.|. |
|00004c00| 20 20 5c 62 65 67 69 6e | 7b 64 65 73 63 72 69 70 | \begin|{descrip|
|00004c10| 74 69 6f 6e 7d 0a 20 20 | 20 20 20 20 20 20 20 20 |tion}. | |
|00004c20| 5c 69 74 65 6d 5b 22 6e | 6f 6e 65 22 5d 20 20 20 |\item["n|one"] |
|00004c30| 47 69 76 65 20 20 74 68 | 65 20 73 6c 61 76 65 20 |Give th|e slave |
|00004c40| 69 74 73 20 72 65 71 75 | 65 73 74 65 64 20 64 69 |its requ|ested di|
|00004c50| 6d 65 6e 73 69 6f 6e 73 | 0a 20 20 20 20 20 20 20 |mensions|. |
|00004c60| 20 20 20 20 20 20 20 20 | 20 20 20 70 6c 75 73 20 | | plus |
|00004c70| 20 61 6e 79 20 20 69 6e | 74 65 72 6e 61 6c 20 20 | any in|ternal |
|00004c80| 20 70 61 64 64 69 6e 67 | 0a 20 20 20 20 20 20 20 | padding|. |
|00004c90| 20 20 20 20 20 20 20 20 | 20 20 72 65 71 75 65 73 | | reques|
|00004ca0| 74 65 64 20 20 77 69 74 | 68 20 20 7b 5c 74 74 20 |ted wit|h {\tt |
|00004cb0| 3a 69 70 61 64 78 7d 20 | 20 6f 72 20 20 7b 5c 74 |:ipadx} | or {\t|
|00004cc0| 74 20 3a 69 70 61 64 79 | 7d 2e 0a 20 20 20 20 20 |t :ipady|}.. |
|00004cd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 54 68 69 73 | | This|
|00004ce0| 20 69 73 20 74 68 65 20 | 64 65 66 61 75 6c 74 2e | is the |default.|
|00004cf0| 0a 0a 20 20 20 20 20 20 | 20 20 20 20 5c 69 74 65 |.. | \ite|
|00004d00| 6d 5b 22 78 22 5d 20 20 | 53 74 72 65 74 63 68 20 |m["x"] |Stretch |
|00004d10| 74 68 65 20 20 73 6c 61 | 76 65 20 20 68 6f 72 69 |the sla|ve hori|
|00004d20| 7a 6f 6e 74 61 6c 6c 79 | 20 20 74 6f 0a 20 20 20 |zontally| to. |
|00004d30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 66 69 | | fi|
|00004d40| 6c 6c 20 20 74 68 65 20 | 65 6e 74 69 72 65 20 77 |ll the |entire w|
|00004d50| 69 64 74 68 20 6f 66 20 | 69 74 73 20 70 61 72 63 |idth of |its parc|
|00004d60| 65 6c 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |el. | |
|00004d70| 20 20 20 20 28 65 78 63 | 65 70 74 20 6c 65 61 76 | (exc|ept leav|
|00004d80| 65 20 20 65 78 74 65 72 | 6e 61 6c 20 20 70 61 64 |e exter|nal pad|
|00004d90| 64 69 6e 67 20 20 61 73 | 0a 20 20 20 20 20 20 20 |ding as|. |
|00004da0| 20 20 20 20 20 20 20 20 | 20 20 73 70 65 63 69 66 | | specif|
|00004db0| 69 65 64 20 62 79 20 7b | 5c 74 74 20 3a 70 61 64 |ied by {|\tt :pad|
|00004dc0| 78 7d 29 2e 0a 0a 20 20 | 20 20 20 20 20 20 20 20 |x})... | |
|00004dd0| 5c 69 74 65 6d 5b 22 79 | 22 5d 20 20 20 20 20 20 |\item["y|"] |
|00004de0| 53 74 72 65 74 63 68 20 | 74 68 65 20 73 6c 61 76 |Stretch |the slav|
|00004df0| 65 20 76 65 72 74 69 63 | 61 6c 6c 79 20 74 6f 20 |e vertic|ally to |
|00004e00| 66 69 6c 6c 0a 20 20 20 | 20 20 20 20 20 20 20 20 |fill. | |
|00004e10| 20 20 20 20 20 20 74 68 | 65 20 20 65 6e 74 69 72 | th|e entir|
|00004e20| 65 20 20 68 65 69 67 68 | 74 20 20 6f 66 20 20 69 |e heigh|t of i|
|00004e30| 74 73 20 20 70 61 72 63 | 65 6c 0a 20 20 20 20 20 |ts parc|el. |
|00004e40| 20 20 20 20 20 20 20 20 | 20 20 20 20 28 65 78 63 | | (exc|
|00004e50| 65 70 74 20 20 6c 65 61 | 76 65 20 20 65 78 74 65 |ept lea|ve exte|
|00004e60| 72 6e 61 6c 20 20 70 61 | 64 64 69 6e 67 20 61 73 |rnal pa|dding as|
|00004e70| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00004e80| 20 20 73 70 65 63 69 66 | 69 65 64 20 62 79 20 7b | specif|ied by {|
|00004e90| 5c 74 74 20 3a 70 61 64 | 79 7d 29 2e 0a 0a 20 20 |\tt :pad|y})... |
|00004ea0| 20 20 20 20 20 20 20 20 | 5c 69 74 65 6d 5b 22 62 | |\item["b|
|00004eb0| 6f 74 68 22 5d 20 20 20 | 53 74 72 65 74 63 68 20 |oth"] |Stretch |
|00004ec0| 74 68 65 20 73 6c 61 76 | 65 20 62 6f 74 68 20 20 |the slav|e both |
|00004ed0| 68 6f 72 69 7a 6f 6e 74 | 61 6c 6c 79 0a 20 20 20 |horizont|ally. |
|00004ee0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 61 6e | | an|
|00004ef0| 64 20 76 65 72 74 69 63 | 61 6c 6c 79 2e 0a 20 20 |d vertic|ally.. |
|00004f00| 20 20 20 20 20 20 20 5c | 65 6e 64 7b 64 65 73 63 | \|end{desc|
|00004f10| 72 69 70 74 69 6f 6e 7d | 0a 20 20 20 20 20 20 20 |ription}|. |
|00004f20| 20 20 5c 65 6e 64 7b 71 | 75 6f 74 65 7d 0a 5c 70 | \end{q|uote}.\p|
|00004f30| 61 72 0a 7b 5c 74 74 20 | 3a 69 6e 20 6f 74 68 65 |ar.{\tt |:in othe|
|00004f40| 72 7d 20 0a 20 20 20 20 | 20 20 20 20 5c 62 65 67 |r} . | \beg|
|00004f50| 69 6e 7b 71 75 6f 74 65 | 7d 20 0a 20 20 20 20 20 |in{quote|} . |
|00004f60| 20 20 20 49 6e 73 65 72 | 74 20 74 68 65 20 73 6c | Inser|t the sl|
|00004f70| 61 76 65 28 73 29 20 61 | 74 20 74 68 65 20 65 6e |ave(s) a|t the en|
|00004f80| 64 20 6f 66 20 74 68 65 | 20 70 61 63 6b 69 6e 67 |d of the| packing|
|00004f90| 0a 20 20 20 20 20 20 20 | 20 6f 72 64 65 72 20 66 |. | order f|
|00004fa0| 6f 72 20 74 68 65 20 6d | 61 73 74 65 72 20 77 69 |or the m|aster wi|
|00004fb0| 6e 64 6f 77 20 67 69 76 | 65 6e 20 62 79 20 6f 74 |ndow giv|en by ot|
|00004fc0| 68 65 72 2e 20 20 0a 20 | 20 20 20 20 20 20 20 5c |her. . | \|
|00004fd0| 65 6e 64 7b 71 75 6f 74 | 65 7d 0a 0a 5c 70 61 72 |end{quot|e}..\par|
|00004fe0| 0a 7b 5c 74 74 20 3a 69 | 70 61 64 78 20 61 6d 6f |.{\tt :i|padx amo|
|00004ff0| 75 6e 74 7d 5c 5c 0a 7b | 5c 74 74 20 3a 69 70 61 |unt}\\.{|\tt :ipa|
|00005000| 64 79 20 61 6d 6f 75 6e | 74 7d 0a 20 20 20 20 20 |dy amoun|t}. |
|00005010| 20 20 20 5c 62 65 67 69 | 6e 7b 71 75 6f 74 65 7d | \begi|n{quote}|
|00005020| 0a 20 20 20 20 20 20 20 | 20 20 7b 5c 74 74 20 41 |. | {\tt A|
|00005030| 6d 6f 75 6e 74 7d 20 73 | 70 65 63 69 66 69 65 73 |mount} s|pecifies|
|00005040| 20 68 6f 77 20 6d 75 63 | 68 20 68 6f 72 69 7a 6f | how muc|h horizo|
|00005050| 6e 74 61 6c 20 28 6f 72 | 20 76 65 72 74 69 63 61 |ntal (or| vertica|
|00005060| 6c 29 20 0a 20 20 20 20 | 20 20 20 20 20 69 6e 74 |l) . | int|
|00005070| 65 72 6e 61 6c 20 70 61 | 64 64 69 6e 67 20 74 6f |ernal pa|dding to|
|00005080| 20 6c 65 61 76 65 20 6f | 6e 20 65 61 63 68 20 73 | leave o|n each s|
|00005090| 69 64 65 20 6f 66 20 74 | 68 65 20 73 6c 61 76 65 |ide of t|he slave|
|000050a0| 28 73 29 2e 20 20 0a 20 | 20 20 20 20 20 20 20 20 |(s). . | |
|000050b0| 7b 5c 74 74 20 41 6d 6f | 75 6e 74 7d 20 6d 75 73 |{\tt Amo|unt} mus|
|000050c0| 74 20 62 65 20 61 20 76 | 61 6c 69 64 20 73 63 72 |t be a v|alid scr|
|000050d0| 65 65 6e 20 20 64 69 73 | 74 61 6e 63 65 2c 20 73 |een dis|tance, s|
|000050e0| 75 63 68 20 61 73 20 32 | 20 6f 72 0a 20 20 20 20 |uch as 2| or. |
|000050f0| 20 20 20 20 20 60 60 2e | 35 63 27 27 2e 20 49 74 | ``.|5c''. It|
|00005100| 20 64 65 66 61 75 6c 74 | 73 20 74 6f 20 30 2e 0a | default|s to 0..|
|00005110| 20 20 20 20 20 20 20 20 | 5c 65 6e 64 7b 71 75 6f | |\end{quo|
|00005120| 74 65 7d 0a 0a 5c 70 61 | 72 0a 7b 5c 74 74 20 3a |te}..\pa|r.{\tt :|
|00005130| 70 61 64 78 20 61 6d 6f | 75 6e 74 7d 5c 5c 0a 7b |padx amo|unt}\\.{|
|00005140| 5c 74 74 20 3a 70 61 64 | 79 20 61 6d 6f 75 6e 74 |\tt :pad|y amount|
|00005150| 7d 20 20 0a 20 20 20 20 | 20 20 20 20 5c 62 65 67 |} . | \beg|
|00005160| 69 6e 7b 71 75 6f 74 65 | 7d 0a 20 20 20 20 20 20 |in{quote|}. |
|00005170| 20 20 7b 5c 74 74 20 41 | 6d 6f 75 6e 74 7d 20 73 | {\tt A|mount} s|
|00005180| 70 65 63 69 66 69 65 73 | 20 68 6f 77 20 6d 75 63 |pecifies| how muc|
|00005190| 68 20 68 6f 72 69 7a 6f | 6e 74 61 6c 20 65 78 74 |h horizo|ntal ext|
|000051a0| 65 72 6e 61 6c 0a 20 20 | 20 20 20 20 20 20 70 61 |ernal. | pa|
|000051b0| 64 64 69 6e 67 20 74 6f | 20 6c 65 61 76 65 20 6f |dding to| leave o|
|000051c0| 6e 20 65 61 63 68 20 73 | 69 64 65 20 6f 66 20 74 |n each s|ide of t|
|000051d0| 68 65 20 73 6c 61 76 65 | 28 73 29 2e 20 20 7b 5c |he slave|(s). {\|
|000051e0| 74 74 20 41 6d 6f 75 6e | 74 7d 0a 20 20 20 20 20 |tt Amoun|t}. |
|000051f0| 20 20 20 64 65 66 61 75 | 6c 74 73 20 74 6f 20 30 | defau|lts to 0|
|00005200| 2e 0a 20 20 20 20 20 20 | 20 20 5c 65 6e 64 7b 71 |.. | \end{q|
|00005210| 75 6f 74 65 7d 0a 0a 5c | 70 61 72 0a 7b 5c 74 74 |uote}..\|par.{\tt|
|00005220| 20 3a 73 69 64 65 20 73 | 69 64 65 7d 0a 20 20 20 | :side s|ide}. |
|00005230| 20 20 20 20 20 5c 62 65 | 67 69 6e 7b 71 75 6f 74 | \be|gin{quot|
|00005240| 65 7d 0a 20 20 20 20 20 | 20 20 20 53 70 65 63 69 |e}. | Speci|
|00005250| 66 69 65 73 20 77 68 69 | 63 68 20 73 69 64 65 20 |fies whi|ch side |
|00005260| 6f 66 20 74 68 65 20 6d | 61 73 74 65 72 20 74 68 |of the m|aster th|
|00005270| 65 20 73 6c 61 76 65 28 | 73 29 20 77 69 6c 6c 20 |e slave(|s) will |
|00005280| 62 65 20 70 61 63 6b 65 | 64 20 61 67 61 69 6e 73 |be packe|d agains|
|00005290| 74 2e 0a 20 20 20 20 20 | 20 20 20 4d 75 73 74 20 |t.. | Must |
|000052a0| 62 65 20 60 60 7b 5c 74 | 74 20 6c 65 66 74 7d 27 |be ``{\t|t left}'|
|000052b0| 27 2c 20 60 60 7b 5c 74 | 74 20 72 69 67 68 74 7d |', ``{\t|t right}|
|000052c0| 27 27 2c 20 60 60 7b 5c | 74 74 20 74 6f 70 7d 27 |'', ``{\|tt top}'|
|000052d0| 27 2c 20 6f 72 20 60 60 | 7b 5c 74 74 0a 20 20 20 |', or ``|{\tt. |
|000052e0| 20 20 20 20 20 62 6f 74 | 74 6f 6d 7d 27 27 2e 20 | bot|tom}''. |
|000052f0| 20 44 65 66 61 75 6c 74 | 73 20 74 6f 20 60 60 7b | Default|s to ``{|
|00005300| 5c 74 74 20 74 6f 70 7d | 27 27 2e 0a 20 20 20 20 |\tt top}|''.. |
|00005310| 20 20 20 20 5c 65 6e 64 | 7b 71 75 6f 74 65 7d 0a | \end|{quote}.|
|00005320| 5c 65 6e 64 7b 71 75 6f | 74 65 7d 0a 49 66 20 6e |\end{quo|te}.If n|
|00005330| 6f 20 7b 5c 74 74 20 3a | 69 6e 7d 2c 20 7b 5c 74 |o {\tt :|in}, {\t|
|00005340| 74 20 3a 61 66 74 65 72 | 7d 20 6f 72 20 7b 5c 74 |t :after|} or {\t|
|00005350| 74 20 3a 62 65 66 6f 72 | 65 7d 20 6f 70 74 69 6f |t :befor|e} optio|
|00005360| 6e 20 69 73 20 73 70 65 | 63 69 66 69 65 64 20 74 |n is spe|cified t|
|00005370| 68 65 6e 0a 65 61 63 68 | 20 6f 66 20 74 68 65 20 |hen.each| of the |
|00005380| 73 6c 61 76 65 73 20 77 | 69 6c 6c 20 62 65 20 69 |slaves w|ill be i|
|00005390| 6e 73 65 72 74 65 64 20 | 61 74 20 74 68 65 20 65 |nserted |at the e|
|000053a0| 6e 64 20 6f 66 20 74 68 | 65 20 70 61 63 6b 69 6e |nd of th|e packin|
|000053b0| 67 20 6c 69 73 74 20 66 | 6f 72 20 69 74 73 0a 70 |g list f|or its.p|
|000053c0| 61 72 65 6e 74 20 75 6e | 6c 65 73 73 20 69 74 20 |arent un|less it |
|000053d0| 69 73 20 61 6c 72 65 61 | 64 79 20 6d 61 6e 61 67 |is alrea|dy manag|
|000053e0| 65 64 20 62 79 20 74 68 | 65 20 70 61 63 6b 65 72 |ed by th|e packer|
|000053f0| 20 28 69 6e 20 77 68 69 | 63 68 20 63 61 73 65 20 | (in whi|ch case |
|00005400| 69 74 20 77 69 6c 6c 20 | 62 65 0a 6c 65 66 74 20 |it will |be.left |
|00005410| 77 68 65 72 65 20 69 74 | 20 69 73 29 2e 20 20 49 |where it| is). I|
|00005420| 66 20 6f 6e 65 20 6f 66 | 20 74 68 65 73 65 20 6f |f one of| these o|
|00005430| 70 74 69 6f 6e 73 20 69 | 73 20 73 70 65 63 69 66 |ptions i|s specif|
|00005440| 69 65 64 20 74 68 65 6e | 20 61 6c 6c 20 74 68 65 |ied then| all the|
|00005450| 0a 73 6c 61 76 65 73 20 | 77 69 6c 6c 20 62 65 20 |.slaves |will be |
|00005460| 69 6e 73 65 72 74 65 64 | 20 61 74 20 74 68 65 20 |inserted| at the |
|00005470| 73 70 65 63 69 66 69 65 | 64 20 70 6f 69 6e 74 2e |specifie|d point.|
|00005480| 20 20 49 66 20 61 6e 79 | 20 6f 66 20 74 68 65 20 | If any| of the |
|00005490| 73 6c 61 76 65 73 20 61 | 72 65 0a 61 6c 72 65 61 |slaves a|re.alrea|
|000054a0| 64 79 20 6d 61 6e 61 67 | 65 64 20 62 79 20 74 68 |dy manag|ed by th|
|000054b0| 65 20 67 65 6f 6d 65 74 | 72 79 20 6d 61 6e 61 67 |e geomet|ry manag|
|000054c0| 65 72 20 74 68 65 6e 20 | 61 6e 79 20 75 6e 73 70 |er then |any unsp|
|000054d0| 65 63 69 66 69 65 64 20 | 6f 70 74 69 6f 6e 73 20 |ecified |options |
|000054e0| 66 6f 72 0a 74 68 65 6d | 20 72 65 74 61 69 6e 20 |for.them| retain |
|000054f0| 74 68 65 69 72 20 70 72 | 65 76 69 6f 75 73 20 76 |their pr|evious v|
|00005500| 61 6c 75 65 73 20 72 61 | 74 68 65 72 20 74 68 61 |alues ra|ther tha|
|00005510| 6e 20 72 65 63 65 69 76 | 69 6e 67 20 64 65 66 61 |n receiv|ing defa|
|00005520| 75 6c 74 20 76 61 6c 75 | 65 73 2e 0a 5c 65 6e 64 |ult valu|es..\end|
|00005530| 7b 71 75 6f 74 65 7d 0a | 0a 5c 70 61 72 61 67 72 |{quote}.|.\paragr|
|00005540| 61 70 68 7b 5c 74 74 20 | 28 70 61 63 6b 20 27 6e |aph{\tt |(pack 'n|
|00005550| 65 77 69 6e 66 6f 20 73 | 6c 61 76 65 29 7d 0a 5c |ewinfo s|lave)}.\|
|00005560| 62 65 67 69 6e 7b 71 75 | 6f 74 65 7d 0a 52 65 74 |begin{qu|ote}.Ret|
|00005570| 75 72 6e 73 20 61 20 6c | 69 73 74 20 77 68 6f 73 |urns a l|ist whos|
|00005580| 65 20 65 6c 65 6d 65 6e | 74 73 20 61 72 65 20 74 |e elemen|ts are t|
|00005590| 68 65 20 63 75 72 72 65 | 6e 74 20 63 6f 6e 66 69 |he curre|nt confi|
|000055a0| 67 75 72 61 74 69 6f 6e | 20 73 74 61 74 65 20 6f |guration| state o|
|000055b0| 66 20 74 68 65 0a 73 6c | 61 76 65 20 67 69 76 65 |f the.sl|ave give|
|000055c0| 6e 20 62 79 20 73 6c 61 | 76 65 20 69 6e 20 74 68 |n by sla|ve in th|
|000055d0| 65 20 73 61 6d 65 20 6f | 70 74 69 6f 6e 2d 76 61 |e same o|ption-va|
|000055e0| 6c 75 65 20 66 6f 72 6d | 20 74 68 61 74 20 6d 69 |lue form| that mi|
|000055f0| 67 68 74 20 62 65 20 73 | 70 65 63 69 66 69 65 64 |ght be s|pecified|
|00005600| 0a 74 6f 20 7b 5c 74 74 | 20 70 61 63 6b 20 27 63 |.to {\tt| pack 'c|
|00005610| 6f 6e 66 69 67 75 72 65 | 7d 2e 20 20 54 68 65 20 |onfigure|}. The |
|00005620| 66 69 72 73 74 20 74 77 | 6f 20 65 6c 65 6d 65 6e |first tw|o elemen|
|00005630| 74 73 20 6f 66 20 74 68 | 65 20 6c 69 73 74 20 61 |ts of th|e list a|
|00005640| 72 65 20 60 60 7b 5c 74 | 74 0a 2d 69 6e 20 6d 61 |re ``{\t|t.-in ma|
|00005650| 73 74 65 72 7d 27 27 20 | 77 68 65 72 65 20 6d 61 |ster}'' |where ma|
|00005660| 73 74 65 72 20 69 73 20 | 74 68 65 20 73 6c 61 76 |ster is |the slav|
|00005670| 65 27 73 20 7b 5c 74 74 | 20 6d 61 73 74 65 72 7d |e's {\tt| master}|
|00005680| 2e 20 20 53 74 61 72 74 | 69 6e 67 20 77 69 74 68 |. Start|ing with|
|00005690| 20 54 6b 0a 34 2e 30 20 | 74 68 69 73 20 6f 70 74 | Tk.4.0 |this opt|
|000056a0| 69 6f 6e 20 77 69 6c 6c | 20 62 65 20 72 65 6e 61 |ion will| be rena|
|000056b0| 6d 65 64 20 60 60 7b 5c | 74 74 20 28 70 61 63 6b |med ``{\|tt (pack|
|000056c0| 20 27 69 6e 66 6f 20 2e | 2e 2e 29 7d 27 27 2e 0a | 'info .|..)}''..|
|000056d0| 5c 65 6e 64 7b 71 75 6f | 74 65 7d 0a 0a 5c 70 61 |\end{quo|te}..\pa|
|000056e0| 72 61 67 72 61 70 68 7b | 5c 74 74 20 28 70 61 63 |ragraph{|\tt (pac|
|000056f0| 6b 20 27 70 72 6f 70 61 | 67 61 74 65 20 6d 61 73 |k 'propa|gate mas|
|00005700| 74 65 72 20 5b 62 6f 6f | 6c 65 61 6e 5d 29 7d 0a |ter [boo|lean])}.|
|00005710| 5c 62 65 67 69 6e 7b 71 | 75 6f 74 65 7d 0a 49 66 |\begin{q|uote}.If|
|00005720| 20 7b 5c 74 74 20 62 6f | 6f 6c 65 61 6e 7d 20 69 | {\tt bo|olean} i|
|00005730| 73 20 7b 5c 74 74 20 5c | 23 74 7d 20 74 68 65 6e |s {\tt \|#t} then|
|00005740| 20 70 72 6f 70 61 67 61 | 74 69 6f 6e 20 69 73 20 | propaga|tion is |
|00005750| 65 6e 61 62 6c 65 64 20 | 66 6f 72 20 7b 5c 74 74 |enabled |for {\tt|
|00005760| 20 6d 61 73 74 65 72 7d | 2c 0a 77 68 69 63 68 20 | master}|,.which |
|00005770| 6d 75 73 74 20 62 65 20 | 61 20 77 69 6e 64 6f 77 |must be |a window|
|00005780| 20 6e 61 6d 65 20 28 73 | 65 65 20 60 60 47 45 4f | name (s|ee ``GEO|
|00005790| 4d 45 54 52 59 20 50 52 | 4f 50 41 47 41 54 49 4f |METRY PR|OPAGATIO|
|000057a0| 4e 27 27 20 62 65 6c 6f | 77 29 2e 20 20 49 66 20 |N'' belo|w). If |
|000057b0| 7b 5c 74 74 0a 62 6f 6f | 6c 65 61 6e 7d 20 68 61 |{\tt.boo|lean} ha|
|000057c0| 73 20 61 20 66 61 6c 73 | 65 20 62 6f 6f 6c 65 61 |s a fals|e boolea|
|000057d0| 6e 20 76 61 6c 75 65 20 | 74 68 65 6e 20 70 72 6f |n value |then pro|
|000057e0| 70 61 67 61 74 69 6f 6e | 20 69 73 20 64 69 73 61 |pagation| is disa|
|000057f0| 62 6c 65 64 20 66 6f 72 | 20 7b 5c 74 74 0a 6d 61 |bled for| {\tt.ma|
|00005800| 73 74 65 72 7d 2e 20 20 | 49 6e 20 65 69 74 68 65 |ster}. |In eithe|
|00005810| 72 20 6f 66 20 74 68 65 | 73 65 20 63 61 73 65 73 |r of the|se cases|
|00005820| 20 61 6e 20 65 6d 70 74 | 79 20 73 74 72 69 6e 67 | an empt|y string|
|00005830| 20 69 73 20 72 65 74 75 | 72 6e 65 64 2e 20 20 49 | is retu|rned. I|
|00005840| 66 20 7b 5c 74 74 20 62 | 6f 6f 6c 65 61 6e 7d 0a |f {\tt b|oolean}.|
|00005850| 69 73 20 6f 6d 69 74 74 | 65 64 20 74 68 65 6e 20 |is omitt|ed then |
|00005860| 74 68 65 20 63 6f 6d 6d | 61 6e 64 20 72 65 74 75 |the comm|and retu|
|00005870| 72 6e 73 20 30 20 6f 72 | 20 31 20 74 6f 20 69 6e |rns 0 or| 1 to in|
|00005880| 64 69 63 61 74 65 20 77 | 68 65 74 68 65 72 20 70 |dicate w|hether p|
|00005890| 72 6f 70 61 67 61 74 69 | 6f 6e 0a 69 73 20 63 75 |ropagati|on.is cu|
|000058a0| 72 72 65 6e 74 6c 79 20 | 65 6e 61 62 6c 65 64 20 |rrently |enabled |
|000058b0| 66 6f 72 20 7b 5c 74 74 | 20 6d 61 73 74 65 72 7d |for {\tt| master}|
|000058c0| 2e 20 20 50 72 6f 70 61 | 67 61 74 69 6f 6e 20 69 |. Propa|gation i|
|000058d0| 73 20 65 6e 61 62 6c 65 | 64 20 62 79 20 64 65 66 |s enable|d by def|
|000058e0| 61 75 6c 74 2e 0a 5c 65 | 6e 64 7b 71 75 6f 74 65 |ault..\e|nd{quote|
|000058f0| 7d 0a 0a 5c 70 61 72 61 | 67 72 61 70 68 7b 5c 74 |}..\para|graph{\t|
|00005900| 74 20 28 70 61 63 6b 20 | 27 73 6c 61 76 65 73 20 |t (pack |'slaves |
|00005910| 6d 61 73 74 65 72 29 7d | 0a 5c 62 65 67 69 6e 7b |master)}|.\begin{|
|00005920| 71 75 6f 74 65 7d 0a 52 | 65 74 75 72 6e 73 20 61 |quote}.R|eturns a|
|00005930| 20 6c 69 73 74 20 6f 66 | 20 61 6c 6c 20 6f 66 20 | list of| all of |
|00005940| 74 68 65 20 73 6c 61 76 | 65 73 20 69 6e 20 74 68 |the slav|es in th|
|00005950| 65 20 70 61 63 6b 69 6e | 67 20 6f 72 64 65 72 20 |e packin|g order |
|00005960| 66 6f 72 20 7b 5c 74 74 | 20 6d 61 73 74 65 72 7d |for {\tt| master}|
|00005970| 2e 0a 54 68 65 20 6f 72 | 64 65 72 20 6f 66 20 74 |..The or|der of t|
|00005980| 68 65 20 73 6c 61 76 65 | 73 20 69 6e 20 74 68 65 |he slave|s in the|
|00005990| 20 6c 69 73 74 20 69 73 | 20 74 68 65 20 73 61 6d | list is| the sam|
|000059a0| 65 20 61 73 20 74 68 65 | 69 72 20 6f 72 64 65 72 |e as the|ir order|
|000059b0| 20 69 6e 20 74 68 65 0a | 70 61 63 6b 69 6e 67 20 | in the.|packing |
|000059c0| 6f 72 64 65 72 2e 20 20 | 49 66 20 7b 5c 74 74 20 |order. |If {\tt |
|000059d0| 6d 61 73 74 65 72 7d 20 | 68 61 73 20 6e 6f 20 73 |master} |has no s|
|000059e0| 6c 61 76 65 73 20 74 68 | 65 6e 20 61 6e 20 65 6d |laves th|en an em|
|000059f0| 70 74 79 20 73 74 72 69 | 6e 67 20 69 73 0a 72 65 |pty stri|ng is.re|
|00005a00| 74 75 72 6e 65 64 2e 0a | 5c 65 6e 64 7b 71 75 6f |turned..|\end{quo|
|00005a10| 74 65 7d 0a 5c 65 6e 64 | 7b 73 63 68 65 6d 65 64 |te}.\end|{schemed|
|00005a20| 6f 63 7d 0a 0a 5c 62 65 | 67 69 6e 7b 73 63 68 65 |oc}..\be|gin{sche|
|00005a30| 6d 65 64 6f 63 7d 7b 44 | 65 73 63 72 69 70 74 69 |medoc}{D|escripti|
|00005a40| 6f 6e 7d 0a 0a 7b 5c 62 | 66 20 54 48 45 20 50 41 |on}..{\b|f THE PA|
|00005a50| 43 4b 45 52 20 41 4c 47 | 4f 52 49 54 48 4d 7d 20 |CKER ALG|ORITHM} |
|00005a60| 46 6f 72 20 65 61 63 68 | 20 6d 61 73 74 65 72 20 |For each| master |
|00005a70| 74 68 65 20 70 61 63 6b | 65 72 20 6d 61 69 6e 74 |the pack|er maint|
|00005a80| 61 69 6e 73 20 61 6e 20 | 6f 72 64 65 72 65 64 0a |ains an |ordered.|
|00005a90| 6c 69 73 74 20 6f 66 20 | 73 6c 61 76 65 73 20 63 |list of |slaves c|
|00005aa0| 61 6c 6c 65 64 20 74 68 | 65 20 7b 5c 65 6d 20 70 |alled th|e {\em p|
|00005ab0| 61 63 6b 69 6e 67 20 6c | 69 73 74 7d 2e 20 20 54 |acking l|ist}. T|
|00005ac0| 68 65 20 7b 5c 74 74 20 | 3a 69 6e 7d 2c 20 7b 5c |he {\tt |:in}, {\|
|00005ad0| 74 74 0a 3a 61 66 74 65 | 72 7d 2c 20 61 6e 64 20 |tt.:afte|r}, and |
|00005ae0| 7b 5c 74 74 20 3a 62 65 | 66 6f 72 65 7d 20 63 6f |{\tt :be|fore} co|
|00005af0| 6e 66 69 67 75 72 61 74 | 69 6f 6e 20 6f 70 74 69 |nfigurat|ion opti|
|00005b00| 6f 6e 73 20 61 72 65 20 | 75 73 65 64 20 74 6f 20 |ons are |used to |
|00005b10| 73 70 65 63 69 66 79 20 | 74 68 65 0a 6d 61 73 74 |specify |the.mast|
|00005b20| 65 72 20 66 6f 72 20 65 | 61 63 68 20 73 6c 61 76 |er for e|ach slav|
|00005b30| 65 20 61 6e 64 20 74 68 | 65 20 73 6c 61 76 65 27 |e and th|e slave'|
|00005b40| 73 20 70 6f 73 69 74 69 | 6f 6e 20 69 6e 20 74 68 |s positi|on in th|
|00005b50| 65 20 70 61 63 6b 69 6e | 67 20 6c 69 73 74 2e 20 |e packin|g list. |
|00005b60| 20 49 66 0a 6e 6f 6e 65 | 20 6f 66 20 74 68 65 73 | If.none| of thes|
|00005b70| 65 20 6f 70 74 69 6f 6e | 73 20 69 73 20 67 69 76 |e option|s is giv|
|00005b80| 65 6e 20 66 6f 72 20 61 | 20 73 6c 61 76 65 20 74 |en for a| slave t|
|00005b90| 68 65 6e 20 74 68 65 20 | 73 6c 61 76 65 20 69 73 |hen the |slave is|
|00005ba0| 20 61 64 64 65 64 20 74 | 6f 20 74 68 65 0a 65 6e | added t|o the.en|
|00005bb0| 64 20 6f 66 20 74 68 65 | 20 70 61 63 6b 69 6e 67 |d of the| packing|
|00005bc0| 20 6c 69 73 74 20 66 6f | 72 20 69 74 73 20 70 61 | list fo|r its pa|
|00005bd0| 72 65 6e 74 2e 0a 0a 54 | 68 65 20 70 61 63 6b 65 |rent...T|he packe|
|00005be0| 72 20 61 72 72 61 6e 67 | 65 73 20 74 68 65 20 73 |r arrang|es the s|
|00005bf0| 6c 61 76 65 73 20 66 6f | 72 20 61 20 6d 61 73 74 |laves fo|r a mast|
|00005c00| 65 72 20 62 79 20 73 63 | 61 6e 6e 69 6e 67 20 74 |er by sc|anning t|
|00005c10| 68 65 20 70 61 63 6b 69 | 6e 67 20 6c 69 73 74 20 |he packi|ng list |
|00005c20| 69 6e 0a 6f 72 64 65 72 | 2e 20 20 41 74 20 74 68 |in.order|. At th|
|00005c30| 65 20 74 69 6d 65 20 69 | 74 20 70 72 6f 63 65 73 |e time i|t proces|
|00005c40| 73 65 73 20 65 61 63 68 | 20 73 6c 61 76 65 2c 20 |ses each| slave, |
|00005c50| 61 20 72 65 63 74 61 6e | 67 75 6c 61 72 20 61 72 |a rectan|gular ar|
|00005c60| 65 61 20 77 69 74 68 69 | 6e 20 74 68 65 0a 6d 61 |ea withi|n the.ma|
|00005c70| 73 74 65 72 20 69 73 20 | 73 74 69 6c 6c 20 75 6e |ster is |still un|
|00005c80| 61 6c 6c 6f 63 61 74 65 | 64 2e 20 20 54 68 69 73 |allocate|d. This|
|00005c90| 20 61 72 65 61 20 69 73 | 20 63 61 6c 6c 65 64 20 | area is| called |
|00005ca0| 74 68 65 20 7b 5c 65 6d | 20 63 61 76 69 74 79 7d |the {\em| cavity}|
|00005cb0| 3b 20 66 6f 72 20 74 68 | 65 0a 66 69 72 73 74 20 |; for th|e.first |
|00005cc0| 73 6c 61 76 65 20 69 74 | 20 69 73 20 74 68 65 20 |slave it| is the |
|00005cd0| 65 6e 74 69 72 65 20 61 | 72 65 61 20 6f 66 20 74 |entire a|rea of t|
|00005ce0| 68 65 20 6d 61 73 74 65 | 72 2e 0a 0a 46 6f 72 20 |he maste|r...For |
|00005cf0| 65 61 63 68 20 73 6c 61 | 76 65 20 74 68 65 20 70 |each sla|ve the p|
|00005d00| 61 63 6b 65 72 20 63 61 | 72 72 69 65 73 20 6f 75 |acker ca|rries ou|
|00005d10| 74 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |t the fo|llowing |
|00005d20| 73 74 65 70 73 3a 0a 0a | 5c 62 65 67 69 6e 7b 65 |steps:..|\begin{e|
|00005d30| 6e 75 6d 65 72 61 74 65 | 7d 0a 5c 69 74 65 6d 0a |numerate|}.\item.|
|00005d40| 54 68 65 20 70 61 63 6b | 65 72 20 61 6c 6c 6f 63 |The pack|er alloc|
|00005d50| 61 74 65 73 20 61 20 72 | 65 63 74 61 6e 67 75 6c |ates a r|ectangul|
|00005d60| 61 72 20 7b 5c 65 6d 20 | 70 61 72 63 65 6c 7d 20 |ar {\em |parcel} |
|00005d70| 66 6f 72 20 74 68 65 20 | 73 6c 61 76 65 0a 61 6c |for the |slave.al|
|00005d80| 6f 6e 67 20 74 68 65 20 | 73 69 64 65 20 6f 66 20 |ong the |side of |
|00005d90| 74 68 65 20 63 61 76 69 | 74 79 20 67 69 76 65 6e |the cavi|ty given|
|00005da0| 20 62 79 20 74 68 65 20 | 73 6c 61 76 65 27 73 20 | by the |slave's |
|00005db0| 7b 5c 74 74 20 3a 73 69 | 64 65 7d 20 6f 70 74 69 |{\tt :si|de} opti|
|00005dc0| 6f 6e 2e 0a 49 66 20 74 | 68 65 20 73 69 64 65 20 |on..If t|he side |
|00005dd0| 69 73 20 74 6f 70 20 6f | 72 20 62 6f 74 74 6f 6d |is top o|r bottom|
|00005de0| 20 74 68 65 6e 20 74 68 | 65 20 77 69 64 74 68 20 | then th|e width |
|00005df0| 6f 66 20 74 68 65 20 70 | 61 72 63 65 6c 20 69 73 |of the p|arcel is|
|00005e00| 0a 74 68 65 20 77 69 64 | 74 68 20 6f 66 20 74 68 |.the wid|th of th|
|00005e10| 65 20 63 61 76 69 74 79 | 20 61 6e 64 20 69 74 73 |e cavity| and its|
|00005e20| 20 68 65 69 67 68 74 20 | 69 73 20 74 68 65 20 72 | height |is the r|
|00005e30| 65 71 75 65 73 74 65 64 | 20 68 65 69 67 68 74 0a |equested| height.|
|00005e40| 6f 66 20 74 68 65 20 73 | 6c 61 76 65 20 70 6c 75 |of the s|lave plu|
|00005e50| 73 20 74 68 65 20 7b 5c | 74 74 20 3a 69 70 61 64 |s the {\|tt :ipad|
|00005e60| 79 7d 20 61 6e 64 20 7b | 5c 74 74 20 3a 70 61 64 |y} and {|\tt :pad|
|00005e70| 79 7d 20 6f 70 74 69 6f | 6e 73 2e 0a 46 6f 72 20 |y} optio|ns..For |
|00005e80| 74 68 65 20 6c 65 66 74 | 20 6f 72 20 72 69 67 68 |the left| or righ|
|00005e90| 74 20 73 69 64 65 20 74 | 68 65 20 68 65 69 67 68 |t side t|he heigh|
|00005ea0| 74 20 6f 66 20 74 68 65 | 20 70 61 72 63 65 6c 20 |t of the| parcel |
|00005eb0| 69 73 0a 74 68 65 20 68 | 65 69 67 68 74 20 6f 66 |is.the h|eight of|
|00005ec0| 20 74 68 65 20 63 61 76 | 69 74 79 20 61 6e 64 20 | the cav|ity and |
|00005ed0| 74 68 65 20 77 69 64 74 | 68 20 69 73 20 74 68 65 |the widt|h is the|
|00005ee0| 20 72 65 71 75 65 73 74 | 65 64 20 77 69 64 74 68 | request|ed width|
|00005ef0| 0a 6f 66 20 74 68 65 20 | 73 6c 61 76 65 20 70 6c |.of the |slave pl|
|00005f00| 75 73 20 74 68 65 20 7b | 5c 74 74 20 3a 69 70 61 |us the {|\tt :ipa|
|00005f10| 64 78 7d 20 61 6e 64 20 | 7b 5c 74 74 20 3a 70 61 |dx} and |{\tt :pa|
|00005f20| 64 78 7d 20 6f 70 74 69 | 6f 6e 73 2e 0a 54 68 65 |dx} opti|ons..The|
|00005f30| 20 70 61 72 63 65 6c 20 | 6d 61 79 20 62 65 20 65 | parcel |may be e|
|00005f40| 6e 6c 61 72 67 65 64 20 | 66 75 72 74 68 65 72 20 |nlarged |further |
|00005f50| 62 65 63 61 75 73 65 20 | 6f 66 20 74 68 65 20 7b |because |of the {|
|00005f60| 5c 74 74 20 3a 65 78 70 | 61 6e 64 7d 0a 6f 70 74 |\tt :exp|and}.opt|
|00005f70| 69 6f 6e 20 28 73 65 65 | 20 60 60 45 58 50 41 4e |ion (see| ``EXPAN|
|00005f80| 53 49 4f 4e 27 27 20 62 | 65 6c 6f 77 29 0a 0a 5c |SION'' b|elow)..\|
|00005f90| 69 74 65 6d 0a 54 68 65 | 20 70 61 63 6b 65 72 20 |item.The| packer |
|00005fa0| 63 68 6f 6f 73 65 73 20 | 74 68 65 20 64 69 6d 65 |chooses |the dime|
|00005fb0| 6e 73 69 6f 6e 73 20 6f | 66 20 74 68 65 20 73 6c |nsions o|f the sl|
|00005fc0| 61 76 65 2e 0a 54 68 65 | 20 77 69 64 74 68 20 77 |ave..The| width w|
|00005fd0| 69 6c 6c 20 6e 6f 72 6d | 61 6c 6c 79 20 62 65 20 |ill norm|ally be |
|00005fe0| 74 68 65 20 73 6c 61 76 | 65 27 73 20 72 65 71 75 |the slav|e's requ|
|00005ff0| 65 73 74 65 64 20 77 69 | 64 74 68 20 70 6c 75 73 |ested wi|dth plus|
|00006000| 0a 74 77 69 63 65 20 69 | 74 73 20 7b 5c 74 74 20 |.twice i|ts {\tt |
|00006010| 3a 69 70 61 64 78 7d 20 | 6f 70 74 69 6f 6e 20 61 |:ipadx} |option a|
|00006020| 6e 64 20 74 68 65 20 68 | 65 69 67 68 74 20 77 69 |nd the h|eight wi|
|00006030| 6c 6c 20 6e 6f 72 6d 61 | 6c 6c 79 20 62 65 0a 74 |ll norma|lly be.t|
|00006040| 68 65 20 73 6c 61 76 65 | 27 73 20 72 65 71 75 65 |he slave|'s reque|
|00006050| 73 74 65 64 20 68 65 69 | 67 68 74 20 70 6c 75 73 |sted hei|ght plus|
|00006060| 20 74 77 69 63 65 20 69 | 74 73 20 7b 5c 74 74 20 | twice i|ts {\tt |
|00006070| 3a 69 70 61 64 79 7d 0a | 6f 70 74 69 6f 6e 2e 0a |:ipady}.|option..|
|00006080| 48 6f 77 65 76 65 72 2c | 20 69 66 20 74 68 65 20 |However,| if the |
|00006090| 7b 5c 74 74 20 3a 66 69 | 6c 6c 7d 20 6f 70 74 69 |{\tt :fi|ll} opti|
|000060a0| 6f 6e 20 69 73 20 60 60 | 7b 5c 74 74 20 78 7d 27 |on is ``|{\tt x}'|
|000060b0| 27 20 6f 72 20 60 60 7b | 5c 74 74 20 62 6f 74 68 |' or ``{|\tt both|
|000060c0| 7d 27 27 0a 74 68 65 6e | 20 74 68 65 20 77 69 64 |}''.then| the wid|
|000060d0| 74 68 20 6f 66 20 74 68 | 65 20 73 6c 61 76 65 20 |th of th|e slave |
|000060e0| 69 73 20 65 78 70 61 6e | 64 65 64 20 74 6f 20 66 |is expan|ded to f|
|000060f0| 69 6c 6c 20 74 68 65 20 | 77 69 64 74 68 20 6f 66 |ill the |width of|
|00006100| 20 74 68 65 20 70 61 72 | 63 65 6c 2c 0a 6d 69 6e | the par|cel,.min|
|00006110| 75 73 20 74 77 69 63 65 | 20 74 68 65 20 7b 5c 74 |us twice| the {\t|
|00006120| 74 20 3a 70 61 64 78 7d | 20 6f 70 74 69 6f 6e 2e |t :padx}| option.|
|00006130| 0a 49 66 20 74 68 65 20 | 7b 5c 74 74 20 3a 66 69 |.If the |{\tt :fi|
|00006140| 6c 6c 7d 20 6f 70 74 69 | 6f 6e 20 69 73 20 60 60 |ll} opti|on is ``|
|00006150| 7b 5c 74 74 20 79 7d 27 | 27 20 6f 72 20 60 60 7b |{\tt y}'|' or ``{|
|00006160| 5c 74 74 20 62 6f 74 68 | 7d 27 27 0a 74 68 65 6e |\tt both|}''.then|
|00006170| 20 74 68 65 20 68 65 69 | 67 68 74 20 6f 66 20 74 | the hei|ght of t|
|00006180| 68 65 20 73 6c 61 76 65 | 20 69 73 20 65 78 70 61 |he slave| is expa|
|00006190| 6e 64 65 64 20 74 6f 20 | 66 69 6c 6c 20 74 68 65 |nded to |fill the|
|000061a0| 20 77 69 64 74 68 20 6f | 66 20 74 68 65 20 70 61 | width o|f the pa|
|000061b0| 72 63 65 6c 2c 0a 6d 69 | 6e 75 73 20 74 77 69 63 |rcel,.mi|nus twic|
|000061c0| 65 20 74 68 65 20 7b 5c | 74 74 20 3a 70 61 64 79 |e the {\|tt :pady|
|000061d0| 7d 20 6f 70 74 69 6f 6e | 2e 0a 0a 5c 69 74 65 6d |} option|...\item|
|000061e0| 0a 54 68 65 20 70 61 63 | 6b 65 72 20 70 6f 73 69 |.The pac|ker posi|
|000061f0| 74 69 6f 6e 73 20 74 68 | 65 20 73 6c 61 76 65 20 |tions th|e slave |
|00006200| 6f 76 65 72 20 69 74 73 | 20 70 61 72 63 65 6c 2e |over its| parcel.|
|00006210| 0a 49 66 20 74 68 65 20 | 73 6c 61 76 65 20 69 73 |.If the |slave is|
|00006220| 20 73 6d 61 6c 6c 65 72 | 20 74 68 61 6e 20 74 68 | smaller| than th|
|00006230| 65 20 70 61 72 63 65 6c | 20 74 68 65 6e 20 74 68 |e parcel| then th|
|00006240| 65 20 7b 5c 74 74 20 3a | 61 6e 63 68 6f 72 7d 0a |e {\tt :|anchor}.|
|00006250| 6f 70 74 69 6f 6e 20 64 | 65 74 65 72 6d 69 6e 65 |option d|etermine|
|00006260| 73 20 77 68 65 72 65 20 | 69 6e 20 74 68 65 20 70 |s where |in the p|
|00006270| 61 72 63 65 6c 20 74 68 | 65 20 73 6c 61 76 65 20 |arcel th|e slave |
|00006280| 77 69 6c 6c 20 62 65 20 | 70 6c 61 63 65 64 2e 0a |will be |placed..|
|00006290| 49 66 20 7b 5c 74 74 20 | 3a 70 61 64 78 7d 20 6f |If {\tt |:padx} o|
|000062a0| 72 20 7b 5c 74 74 20 3a | 70 61 64 79 7d 20 69 73 |r {\tt :|pady} is|
|000062b0| 20 6e 6f 6e 2d 7a 65 72 | 6f 2c 20 74 68 65 6e 20 | non-zer|o, then |
|000062c0| 74 68 65 20 67 69 76 65 | 6e 0a 61 6d 6f 75 6e 74 |the give|n.amount|
|000062d0| 20 6f 66 20 65 78 74 65 | 72 6e 61 6c 20 70 61 64 | of exte|rnal pad|
|000062e0| 64 69 6e 67 20 77 69 6c | 6c 20 61 6c 77 61 79 73 |ding wil|l always|
|000062f0| 20 62 65 20 6c 65 66 74 | 20 62 65 74 77 65 65 6e | be left| between|
|00006300| 20 74 68 65 0a 73 6c 61 | 76 65 20 61 6e 64 20 74 | the.sla|ve and t|
|00006310| 68 65 20 65 64 67 65 73 | 20 6f 66 20 74 68 65 20 |he edges| of the |
|00006320| 70 61 72 63 65 6c 2e 0a | 5c 65 6e 64 7b 65 6e 75 |parcel..|\end{enu|
|00006330| 6d 65 72 61 74 65 7d 0a | 0a 4f 6e 63 65 20 61 20 |merate}.|.Once a |
|00006340| 67 69 76 65 6e 20 73 6c | 61 76 65 20 68 61 73 20 |given sl|ave has |
|00006350| 62 65 65 6e 20 70 61 63 | 6b 65 64 2c 20 74 68 65 |been pac|ked, the|
|00006360| 20 61 72 65 61 20 6f 66 | 20 69 74 73 20 70 61 72 | area of| its par|
|00006370| 63 65 6c 20 69 73 20 73 | 75 62 74 72 61 63 74 65 |cel is s|ubtracte|
|00006380| 64 0a 66 72 6f 6d 20 74 | 68 65 20 63 61 76 69 74 |d.from t|he cavit|
|00006390| 79 2c 20 6c 65 61 76 69 | 6e 67 20 61 20 73 6d 61 |y, leavi|ng a sma|
|000063a0| 6c 6c 65 72 20 72 65 63 | 74 61 6e 67 75 6c 61 72 |ller rec|tangular|
|000063b0| 20 63 61 76 69 74 79 20 | 66 6f 72 20 74 68 65 20 | cavity |for the |
|000063c0| 6e 65 78 74 20 73 6c 61 | 76 65 2e 0a 49 66 20 61 |next sla|ve..If a|
|000063d0| 20 73 6c 61 76 65 20 64 | 6f 65 73 6e 27 74 20 75 | slave d|oesn't u|
|000063e0| 73 65 20 61 6c 6c 20 6f | 66 20 69 74 73 20 70 61 |se all o|f its pa|
|000063f0| 72 63 65 6c 2c 20 74 68 | 65 20 75 6e 75 73 65 64 |rcel, th|e unused|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.